ansible-later/env_27/lib/python2.7/site-packages/flake8_blind_except.py

22 lines
482 B
Python
Raw Normal View History

2019-04-11 13:56:20 +00:00
try:
import pycodestyle
except ImportError:
import pep8 as pycodestyle
import re
__version__ = '0.1.1'
BLIND_EXCEPT_REGEX = re.compile(r'(except:)') # noqa
def check_blind_except(physical_line):
if pycodestyle.noqa(physical_line):
return
match = BLIND_EXCEPT_REGEX.search(physical_line)
if match:
return match.start(), 'B901 blind except: statement'
check_blind_except.name = 'flake8-blind-except'
check_blind_except.version = __version__