]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
InteractiveInterpreter.showsyntaxerror():
authorFred Drake <fdrake@acm.org>
Thu, 3 May 2001 04:58:49 +0000 (04:58 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 3 May 2001 04:58:49 +0000 (04:58 +0000)
    When replacing the exception object, be sure we stuff the new value
    in sys.last_value (which we already did for the original value).

Lib/code.py

index ab1050c12e7c6f47864820212cc42ec951c0e3fc..d56681c9e623cb8f581a14d18708e201e6a67ea1 100644 (file)
@@ -137,6 +137,7 @@ class InteractiveInterpreter:
                 except:
                     # If that failed, assume SyntaxError is a string
                     value = msg, (filename, lineno, offset, line)
+                sys.last_value = value
         list = traceback.format_exception_only(type, value)
         map(self.write, list)