mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-01 03:26:52 +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 = []
|
||||
try:
|
||||
ast = parse(code)
|
||||
except AttributeError:
|
||||
except (AttributeError, SyntaxError):
|
||||
e = sys.exc_info()[1]
|
||||
sys.stderr.write("Unable to parse %s: %s\n" % (filename, e))
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue