diff options
| author | Anthony Sottile <asottile@umich.edu> | 2019-04-07 07:35:46 -0700 |
|---|---|---|
| committer | Anthony Sottile <asottile@umich.edu> | 2019-04-07 07:42:00 -0700 |
| commit | 38ab47702a1cfa451af2e74a95ed145a0f4b2d5a (patch) | |
| tree | 0998b8b4629883be36285636d4de52b56f16c5c1 /src/flake8 | |
| parent | 2b333fad1abe0bdb2e04132eabb0822e6ce63888 (diff) | |
| download | flake8-38ab47702a1cfa451af2e74a95ed145a0f4b2d5a.tar.gz | |
Fix crash when file fails to tokenize but parses
Diffstat (limited to 'src/flake8')
| -rw-r--r-- | src/flake8/checker.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/flake8/checker.py b/src/flake8/checker.py index d3ce35e..4fb106e 100644 --- a/src/flake8/checker.py +++ b/src/flake8/checker.py @@ -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 |
