aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/code.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/code.py')
-rw-r--r--Lib/code.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/Lib/code.py b/Lib/code.py
index b1079824a75..c559191d8a7 100644
--- a/Lib/code.py
+++ b/Lib/code.py
@@ -109,15 +109,7 @@ class InteractiveInterpreter:
try:
typ, value, tb = sys.exc_info()
if filename and typ is SyntaxError:
- # Work hard to stuff the correct filename in the exception
- try:
- msg, (dummy_filename, lineno, offset, line) = value.args
- except ValueError:
- # Not the format we expect; leave it alone
- pass
- else:
- # Stuff in the right filename
- value = SyntaxError(msg, (filename, lineno, offset, line))
+ value.filename = filename
source = kwargs.pop('source', "")
self._showtraceback(typ, value, None, source)
finally: