summaryrefslogtreecommitdiff
path: root/Lib/code.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-05-03 04:58:49 +0000
committerFred Drake <fdrake@acm.org>2001-05-03 04:58:49 +0000
commit26871a59e6c3786a75d1905110c9ea73eead01ab (patch)
treebc015d66f9317854a715a1d17defb1cbfae53f17 /Lib/code.py
parentad2916a8ab85cadbc79c22951de52df9c6ad141c (diff)
downloadcpython-26871a59e6c3786a75d1905110c9ea73eead01ab.tar.gz
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).
Diffstat (limited to 'Lib/code.py')
-rw-r--r--Lib/code.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/code.py b/Lib/code.py
index ab1050c12e..d56681c9e6 100644
--- a/Lib/code.py
+++ b/Lib/code.py
@@ -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)