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
|
@ -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…
Reference in New Issue