mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
InteractiveInterpreter.showsyntaxerror():
When replacing the exception object, be sure we stuff the new value in sys.last_value (which we already did for the original value).
This commit is contained in:
parent
a7cc69e02e
commit
c7745d4b54
1 changed files with 1 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue