Utilities/__init__.py

branch
5_2_x
changeset 1815
6ed2ac61a108
parent 1660
57f2bd52deb7
child 1840
7c1e74e196a9
diff -r 790aa44f5dcc -r 6ed2ac61a108 Utilities/__init__.py
--- a/Utilities/__init__.py	Wed Apr 25 19:48:57 2012 +0200
+++ b/Utilities/__init__.py	Fri Apr 27 19:10:34 2012 +0200
@@ -1272,27 +1272,30 @@
                     Preferences.getSystem("IOEncoding"),
                     'replace').splitlines()
         
-        syntaxerror = output[0] == "ERROR"
-        if syntaxerror:
-            fn = output[1]
-            line = output[2]
-            index = output[3]
-            code = output[4]
-            error = output[5]
-            return (True, fn, line, index, code, error, [])
+        if output:
+            syntaxerror = output[0] == "ERROR"
+            if syntaxerror:
+                fn = output[1]
+                line = output[2]
+                index = output[3]
+                code = output[4]
+                error = output[5]
+                return (True, fn, line, index, code, error, [])
+            else:
+                index = 6
+                warnings = []
+                while len(output) - index > 3:
+                    if output[index] == "FLAKES_ERROR":
+                        return (True, output[index + 1], output[index + 2], "",
+                                output[index + 3], [])
+                    else:
+                        warnings.append((output[index + 1], output[index + 2],
+                                         output[index + 3]))
+                    index += 4
+                
+                return (False, None, None, None, None, None, warnings)
         else:
-            index = 6
-            warnings = []
-            while len(output) - index > 3:
-                if output[index] == "FLAKES_ERROR":
-                    return (True, output[index + 1], output[index + 2], "",
-                            output[index + 3], [])
-                else:
-                    warnings.append((output[index + 1], output[index + 2],
-                                     output[index + 3]))
-                index += 4
-            
-            return (False, None, None, None, None, None, warnings)
+            return (False, "", "", "", "", "", [])
     
     return (True, file, "1", "0", "",
         QCoreApplication.translate("Utilities",

eric ide

mercurial