mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-09 14:24:17 +00:00
make sure mccacbe catches the syntax errors as warnings
This commit is contained in:
parent
2c1d836b31
commit
dd92d52f06
1 changed files with 1 additions and 1 deletions
|
|
@ -231,7 +231,7 @@ def get_code_complexity(code, min=7, filename='stdin'):
|
||||||
complex = []
|
complex = []
|
||||||
try:
|
try:
|
||||||
ast = parse(code)
|
ast = parse(code)
|
||||||
except AttributeError:
|
except (AttributeError, SyntaxError):
|
||||||
e = sys.exc_info()[1]
|
e = sys.exc_info()[1]
|
||||||
sys.stderr.write("Unable to parse %s: %s\n" % (filename, e))
|
sys.stderr.write("Unable to parse %s: %s\n" % (filename, e))
|
||||||
return 0
|
return 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue