Fri, 30 Sep 2016 19:38:17 +0200
- Fixed an interesting issue showing up when the code contains an invalid future statement in the Python 2 debugger.
- Added a fix for the Python 3 debugger.
DebugClients/Python/DebugBase.py | file | annotate | diff | comparison | revisions | |
DebugClients/Python3/DebugBase.py | file | annotate | diff | comparison | revisions |
--- 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,
--- a/DebugClients/Python3/DebugBase.py Fri Sep 30 19:21:22 2016 +0200 +++ b/DebugClients/Python3/DebugBase.py Fri Sep 30 19:38:17 2016 +0200 @@ -731,19 +731,19 @@ if exctype in [SyntaxError, IndentationError]: try: - printerr("1") message = str(excval) filename = excval.filename - linenr = excval.lineno - charnr = excval.offset + 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 (AttributeError, ValueError): exclist = [] realSyntaxError = True - else: - exclist = [message, [filename, linenr, charnr]] - realSyntaxError = os.path.exists(filename) if realSyntaxError: self._dbgClient.write("{0}{1}\n".format(