Plugins/CheckerPlugins/Pep8/pep8.py

branch
5_3_x
changeset 3084
bb490ec69f98
parent 2931
552d5934c6f6
child 3163
9f50365a0870
equal deleted inserted replaced
3082:fd9748323ce6 3084:bb490ec69f98
1108 # The comment also ends a physical line. This works around 1108 # The comment also ends a physical line. This works around
1109 # Python < 2.6 behaviour, which does not generate NL after 1109 # Python < 2.6 behaviour, which does not generate NL after
1110 # a comment which is on a line by itself. 1110 # a comment which is on a line by itself.
1111 self.tokens = [] 1111 self.tokens = []
1112 except (SyntaxError, tokenize.TokenError) as err: 1112 except (SyntaxError, tokenize.TokenError) as err:
1113 msg, (lnum, pos) = err.args 1113 msg = err.args[0]
1114 self.report_error_args(lnum, pos, "E901", "TokenError", msg) 1114 if len(err.args) > 1:
1115 offset = err.args[1]
1116 if len(offset) > 2:
1117 offset = offset[1:3]
1118 else:
1119 offset = (1, 0)
1120 self.report_error_args(
1121 offset[0], offset[1] or 0, "E901", "TokenError", msg)
1115 return self.file_errors 1122 return self.file_errors
1116 1123
1117 def report_error(self, line_number, offset, text, check): 1124 def report_error(self, line_number, offset, text, check):
1118 """ 1125 """
1119 Report an error, according to options. 1126 Report an error, according to options.

eric ide

mercurial