diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2013-02-13 08:58:56 +0100 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2013-02-13 08:58:56 +0100 |
commit | 9dfb34e7d833c9a417a28737425de7cd34f59186 (patch) | |
tree | 6292c1b774bc779ff2431f24a6bf03249110a55f | |
parent | 030ac6e3c7a3cf09209d2bb3afeb560a530f0c06 (diff) | |
download | pep8-9dfb34e7d833c9a417a28737425de7cd34f59186.tar.gz |
Fix crash with AST checkers when the syntax is invalid. Issue #160
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rwxr-xr-x | pep8.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 84c92af..a2decfb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,6 +7,8 @@ Changelog * Hide the ``--doctest`` and ``--testsuite`` options when installed. +* Fix crash with AST checkers when the syntax is invalid. (Issue #160) + 1.4.2 (2013-02-10) ------------------ @@ -1221,7 +1221,7 @@ class Checker(object): offset = exc.args[1] if len(offset) > 2: offset = offset[1:3] - self.report_error(offset[0], offset[1], + self.report_error(offset[0], offset[1] or 0, 'E901 %s: %s' % (exc_type.__name__, exc.args[0]), self.report_invalid_syntax) report_invalid_syntax.__doc__ = " Check if the syntax is valid." |