eric6/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py

changeset 7639
422fd05e9c91
parent 7637
c878e8255972
child 7900
72b88fb20261
child 7924
8a96736d465e
equal deleted inserted replaced
7638:176145438b1e 7639:422fd05e9c91
2 2
3 # Copyright (c) 2011 - 2020 Detlev Offenbach <detlev@die-offenbachs.de> 3 # Copyright (c) 2011 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the syntax check for Python 2/3. 7 Module implementing the syntax check for Python 3.
8 """ 8 """
9 9
10 import queue 10 import queue
11 import ast 11 import ast
12 import re 12 import re
215 @return dictionary with the keys 'error' and 'warnings' which 215 @return dictionary with the keys 'error' and 'warnings' which
216 hold a list containing details about the error/ warnings 216 hold a list containing details about the error/ warnings
217 (file name, line number, column, codestring (only at syntax 217 (file name, line number, column, codestring (only at syntax
218 errors), the message, a list with arguments for the message) 218 errors), the message, a list with arguments for the message)
219 """ 219 """
220 try: 220 import builtins
221 import builtins
222 except ImportError:
223 import __builtin__ as builtins # __IGNORE_WARNING__
224 221
225 try: 222 try:
226 codestring = normalizeCode(codestring) 223 codestring = normalizeCode(codestring)
227 224
228 # Check for VCS conflict markers 225 # Check for VCS conflict markers
323 else: 320 else:
324 msg = err.msg 321 msg = err.msg
325 results.append((filename, err.lineno, 0, "FLAKES_ERROR", msg, [])) 322 results.append((filename, err.lineno, 0, "FLAKES_ERROR", msg, []))
326 323
327 return [{'warnings': results}] 324 return [{'warnings': results}]
328
329 #
330 # eflag: noqa = M702

eric ide

mercurial