def bare_except(logical_line, noqa):
 if noqa:
  return
 regex = re.compile('except\\s*:')
 match = regex.match(logical_line)
 if match:
  (yield (match.start(), "E722 do not use bare except'"))

def bare_except ( logical_line , noqa ) : if noqa : return regex = re . compile ( 'except\\s*:' ) match = regex . match ( logical_line ) if match : ( yield ( match . start ( ) , "E722 do not use bare except'" ) )
when catching exceptions .