UtilitiesPython2/pep8.py

branch
5_3_x
changeset 2931
552d5934c6f6
parent 2801
8ccc38b80dc2
child 3163
9f50365a0870
equal deleted inserted replaced
2924:66c644db24f4 2931:552d5934c6f6
996 if text.endswith('\n') and not parens: 996 if text.endswith('\n') and not parens:
997 # The comment also ends a physical line. This works around 997 # The comment also ends a physical line. This works around
998 # Python < 2.6 behaviour, which does not generate NL after 998 # Python < 2.6 behaviour, which does not generate NL after
999 # a comment which is on a line by itself. 999 # a comment which is on a line by itself.
1000 self.tokens = [] 1000 self.tokens = []
1001 except tokenize.TokenError, err: 1001 except (SyntaxError, tokenize.TokenError) as err:
1002 msg, (lnum, pos) = err.args 1002 msg, (lnum, pos) = err.args
1003 self.report_error_args(lnum, pos, "E901", "TokenError", msg) 1003 self.report_error_args(lnum, pos, "E901", "TokenError", msg)
1004 return self.file_errors 1004 return self.file_errors
1005 1005
1006 def report_error(self, line_number, offset, text, check): 1006 def report_error(self, line_number, offset, text, check):

eric ide

mercurial