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:
Fred Drake 2001-05-03 04:58:49 +00:00
parent a7cc69e02e
commit c7745d4b54
1 changed files with 1 additions and 0 deletions

View 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)