We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0f079a0 + 60dc2b0 commit 8ba139dCopy full SHA for 8ba139d
pycodestyle.py
@@ -164,6 +164,7 @@ def lru_cache(maxsize=128): # noqa as it's a fake implementation.
164
)
165
DUNDER_REGEX = re.compile(r'^__([^\s]+)__ = ')
166
MATCH_CASE_REGEX = re.compile(r'^\s*\b(?:match|case)(\s*)(?=.*\:)')
167
+BLANK_EXCEPT_REGEX = re.compile(r"except\s*:")
168
169
_checks = {'physical_line': {}, 'logical_line': {}, 'tree': {}}
170
@@ -1488,8 +1489,7 @@ def bare_except(logical_line, noqa):
1488
1489
if noqa:
1490
return
1491
- regex = re.compile(r"except\s*:")
1492
- match = regex.match(logical_line)
+ match = BLANK_EXCEPT_REGEX.match(logical_line)
1493
if match:
1494
yield match.start(), "E722 do not use bare 'except'"
1495
0 commit comments