Fixed an interesting issue showing up when the code contains an invalid future statement. 6_1_x

Fri, 30 Sep 2016 19:21:22 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 30 Sep 2016 19:21:22 +0200
branch
6_1_x
changeset 5186
3e43c809a129
parent 5177
d6bdb0f706b9
child 5187
ef0fcefe97f8

Fixed an interesting issue showing up when the code contains an invalid future statement.
(grafted from 79b3922094ba69ebfbc2c7aab76c7933f3ce452c)

DebugClients/Python3/DebugBase.py file | annotate | diff | comparison | revisions
DebugClients/Python3/DebugClientBase.py file | annotate | diff | comparison | revisions
diff -r d6bdb0f706b9 -r 3e43c809a129 DebugClients/Python3/DebugBase.py
--- a/DebugClients/Python3/DebugBase.py	Sat Sep 24 18:00:30 2016 +0200
+++ b/DebugClients/Python3/DebugBase.py	Fri Sep 30 19:21:22 2016 +0200
@@ -731,10 +731,13 @@
         
         if exctype in [SyntaxError, IndentationError]:
             try:
+                printerr("1")
                 message = str(excval)
                 filename = excval.filename
                 linenr = excval.lineno
                 charnr = excval.offset
+                if charno is None:
+                    charno = 0
             except (AttributeError, ValueError):
                 exclist = []
                 realSyntaxError = True
diff -r d6bdb0f706b9 -r 3e43c809a129 DebugClients/Python3/DebugClientBase.py
--- a/DebugClients/Python3/DebugClientBase.py	Sat Sep 24 18:00:30 2016 +0200
+++ b/DebugClients/Python3/DebugClientBase.py	Fri Sep 30 19:21:22 2016 +0200
@@ -374,6 +374,8 @@
                 filename = excval.filename
                 linenr = excval.lineno
                 charnr = excval.offset
+                if charno is None:
+                    charno = 0
             except (AttributeError, ValueError):
                 exclist = []
             else:

eric ide

mercurial