Fixed an error in the pep8 checkers. 5_3_x

Tue, 24 Sep 2013 18:32:18 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 24 Sep 2013 18:32:18 +0200
branch
5_3_x
changeset 2931
552d5934c6f6
parent 2924
66c644db24f4
child 2932
1cf0eb73b52d

Fixed an error in the pep8 checkers.

Plugins/CheckerPlugins/Pep8/pep8.py file | annotate | diff | comparison | revisions
UtilitiesPython2/pep8.py file | annotate | diff | comparison | revisions
diff -r 66c644db24f4 -r 552d5934c6f6 Plugins/CheckerPlugins/Pep8/pep8.py
--- a/Plugins/CheckerPlugins/Pep8/pep8.py	Wed Sep 18 19:48:12 2013 +0200
+++ b/Plugins/CheckerPlugins/Pep8/pep8.py	Tue Sep 24 18:32:18 2013 +0200
@@ -1109,7 +1109,7 @@
                         # Python < 2.6 behaviour, which does not generate NL after
                         # a comment which is on a line by itself.
                         self.tokens = []
-        except tokenize.TokenError as err:
+        except (SyntaxError, tokenize.TokenError) as err:
             msg, (lnum, pos) = err.args
             self.report_error_args(lnum, pos, "E901", "TokenError", msg)
         return self.file_errors
diff -r 66c644db24f4 -r 552d5934c6f6 UtilitiesPython2/pep8.py
--- a/UtilitiesPython2/pep8.py	Wed Sep 18 19:48:12 2013 +0200
+++ b/UtilitiesPython2/pep8.py	Tue Sep 24 18:32:18 2013 +0200
@@ -998,7 +998,7 @@
                         # Python < 2.6 behaviour, which does not generate NL after
                         # a comment which is on a line by itself.
                         self.tokens = []
-        except tokenize.TokenError, err:
+        except (SyntaxError, tokenize.TokenError) as err:
             msg, (lnum, pos) = err.args
             self.report_error_args(lnum, pos, "E901", "TokenError", msg)
         return self.file_errors

eric ide

mercurial