Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7745d4

Browse files
committed
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).
1 parent a7cc69e commit c7745d4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Lib/code.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def showsyntaxerror(self, filename=None):
137137
except:
138138
# If that failed, assume SyntaxError is a string
139139
value = msg, (filename, lineno, offset, line)
140+
sys.last_value = value
140141
list = traceback.format_exception_only(type, value)
141142
map(self.write, list)
142143

0 commit comments

Comments
 (0)