mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-04 20:26:53 +00:00
Fix crash when file fails to tokenize but parses
This commit is contained in:
parent
2b333fad1a
commit
38ab47702a
2 changed files with 15 additions and 2 deletions
|
|
@ -597,6 +597,7 @@ class FileChecker(object):
|
|||
"""Run checks against the file."""
|
||||
try:
|
||||
self.process_tokens()
|
||||
self.run_ast_checks()
|
||||
except exceptions.InvalidSyntax as exc:
|
||||
self.report(
|
||||
exc.error_code,
|
||||
|
|
@ -605,8 +606,6 @@ class FileChecker(object):
|
|||
exc.error_message,
|
||||
)
|
||||
|
||||
self.run_ast_checks()
|
||||
|
||||
logical_lines = self.processor.statistics["logical lines"]
|
||||
self.statistics["logical lines"] = logical_lines
|
||||
return self.filename, self.results, self.statistics
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue