diff options
-rwxr-xr-x | pycodestyle.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pycodestyle.py b/pycodestyle.py index 4055716..0d8ed50 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -171,6 +171,7 @@ STARTSWITH_INDENT_STATEMENT_REGEX = re.compile( ) DUNDER_REGEX = re.compile(r'^__([^\s]+)__ = ') MATCH_CASE_REGEX = re.compile(r'^\s*\b(?:match|case)(\s*)(?=.*\:)') +BLANK_EXCEPT_REGEX = re.compile(r"except\s*:") _checks = {'physical_line': {}, 'logical_line': {}, 'tree': {}} @@ -1495,8 +1496,7 @@ def bare_except(logical_line, noqa): if noqa: return - regex = re.compile(r"except\s*:") - match = regex.match(logical_line) + match = BLANK_EXCEPT_REGEX.match(logical_line) if match: yield match.start(), "E722 do not use bare 'except'" |