Fixed an issue in the Python3 debugger backend handling syntax errors.

Sat, 16 Nov 2013 18:02:43 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 16 Nov 2013 18:02:43 +0100
changeset 3085
4a0f54a64496
parent 3083
6382a74d9599
child 3087
fdbce259929f

Fixed an issue in the Python3 debugger backend handling syntax errors.

DebugClients/Python3/DebugBase.py file | annotate | diff | comparison | revisions
DebugClients/Python3/DebugClientBase.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python3/DebugBase.py	Sat Nov 16 17:16:55 2013 +0100
+++ b/DebugClients/Python3/DebugBase.py	Sat Nov 16 18:02:43 2013 +0100
@@ -661,9 +661,11 @@
         
         if exctype in [SyntaxError, IndentationError]:
             try:
-                message, (filename, linenr, charnr, text) = \
-                    excval[0], excval[1]
-            except ValueError:
+                message = str(excval)
+                filename = excval.filename
+                linenr = excval.lineno
+                charnr = excval.offset
+            except (AttributeError, ValueError):
                 exclist = []
                 realSyntaxError = True
             else:
--- a/DebugClients/Python3/DebugClientBase.py	Sat Nov 16 17:16:55 2013 +0100
+++ b/DebugClients/Python3/DebugClientBase.py	Sat Nov 16 18:02:43 2013 +0100
@@ -364,9 +364,11 @@
         except SyntaxError:
             exctype, excval, exctb = sys.exc_info()
             try:
-                message, (filename, linenr, charnr, text) = \
-                    excval[0], excval[1]
-            except ValueError:
+                message = str(excval)
+                filename = excval.filename
+                linenr = excval.lineno
+                charnr = excval.offset
+            except (AttributeError, ValueError):
                 exclist = []
             else:
                 exclist = [message, [filename, linenr, charnr]]

eric ide

mercurial