Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py

changeset 4385
599681bf149a
parent 4236
8d4e498a7af8
child 4541
e8ddd9d76414
equal deleted inserted replaced
4384:04896c4a5a8e 4385:599681bf149a
226 error = "" 226 error = ""
227 lines = traceback.format_exception_only(SyntaxError, detail) 227 lines = traceback.format_exception_only(SyntaxError, detail)
228 if sys.version_info[0] == 2: 228 if sys.version_info[0] == 2:
229 lines = [x.decode(sys.getfilesystemencoding()) for x in lines] 229 lines = [x.decode(sys.getfilesystemencoding()) for x in lines]
230 match = re.match('\s*File "(.+)", line (\d+)', 230 match = re.match('\s*File "(.+)", line (\d+)',
231 lines[0].replace('<string>', '{0}'.format(filename))) 231 lines[0].replace('<string>', filename))
232 if match is not None: 232 if match is not None:
233 fn, line = match.group(1, 2) 233 fn, line = match.group(1, 2)
234 if lines[1].startswith('SyntaxError:'): 234 if lines[1].startswith('SyntaxError:'):
235 error = re.match('SyntaxError: (.+)', lines[1]).group(1) 235 error = re.match('SyntaxError: (.+)', lines[1]).group(1)
236 else: 236 else:

eric ide

mercurial