Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py

branch
BgService
changeset 3177
5af61402d74d
parent 3173
1fb284abe46e
child 3228
f489068e51e8
diff -r 86047f5f4155 -r 5af61402d74d Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py	Sat Jan 04 22:14:38 2014 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py	Sun Jan 05 22:45:29 2014 +0100
@@ -143,8 +143,6 @@
             error = detail.msg
         return (True, fn, int(line), index, code, error, [])
     except ValueError as detail:
-        index = 0
-        code = ""
         try:
             fn = detail.filename
             line = detail.lineno
@@ -153,15 +151,13 @@
             fn = filename
             line = 1
             error = str(detail)
-        return (True, fn, line, index, code, error, [])
+        return (True, fn, line, 0, "", error, [])
     except Exception as detail:
         try:
             fn = detail.filename
             line = detail.lineno
-            index = 0
-            code = ""
             error = detail.msg
-            return (True, fn, line, index, code, error, [])
+            return (True, fn, line, 0, "", error, [])
         except:         # this catchall is intentional
             pass
     
@@ -179,16 +175,16 @@
                     isinstance(warning, ImportStarUsed):
                 continue
             
-            _fn, lineno, message, msg_args = warning.getMessageData()
+            _fn, lineno, col, message, msg_args = warning.getMessageData()
             if "__IGNORE_WARNING__" not in extractLineFlags(
                     lines[lineno - 1].strip()):
                 strings.append([
-                    "FLAKES_WARNING", _fn, lineno, message, msg_args])
+                    "FLAKES_WARNING", _fn, lineno, col, message, msg_args])
     except SyntaxError as err:
         if err.text.strip():
             msg = err.text.strip()
         else:
             msg = err.msg
-        strings.append(["FLAKES_ERROR", filename, err.lineno, msg, ()])
+        strings.append(["FLAKES_ERROR", filename, err.lineno, 0, msg, ()])
     
     return (False, "", -1, -1, "", "", strings)

eric ide

mercurial