DebugClients/Python/DebugBase.py

branch
6_1_x
changeset 5187
ef0fcefe97f8
parent 5164
197acc53a662
--- a/DebugClients/Python/DebugBase.py	Fri Sep 30 19:21:22 2016 +0200
+++ b/DebugClients/Python/DebugBase.py	Fri Sep 30 19:38:17 2016 +0200
@@ -695,13 +695,22 @@
         
         if exctype in [SyntaxError, IndentationError]:
             try:
-                message, (filename, linenr, charnr, text) = excval
+                if type(excval) == tuple:
+                    message, (filename, lineno, charno, text) = excval
+                else:
+                    message = excval.msg
+                    filename = excval.filename
+                    lineno = excval.lineno
+                    charno = excval.offset
+                    if charno is None:
+                        charno = 0
+                
+                exclist = [message, [filename, lineno, charno]]
+                filename = os.path.abspath(filename)
+                realSyntaxError = os.path.exists(filename)
             except ValueError:
                 exclist = []
                 realSyntaxError = True
-            else:
-                exclist = [message, [filename, linenr, charnr]]
-                realSyntaxError = os.path.exists(filename)
             
             if realSyntaxError:
                 self._dbgClient.write("%s%s\n" % (ResponseSyntax,

eric ide

mercurial