Closed
Description
Bug report
If sys.systemhook
is not sys.__systemhook__
, the new REPL outputs the line in the code module in the traceback:
>>> xxx
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
xxx
NameError: name 'xxx' is not defined
>>> import sys; sys.excepthook = lambda *args: sys.__excepthook__(*args)
>>> xxx
Traceback (most recent call last):
File "/home/serhiy/py/cpython/Lib/code.py", line 91, in runcode
exec(code, self.locals)
~~~~^^^^^^^^^^^^^^^^^^^
File "<python-input-2>", line 1, in <module>
xxx
NameError: name 'xxx' is not defined
Linked PRs
- gh-122478: Remove internal frames from tracebacks in REPL #122528
- [3.12] gh-122478: Remove internal frames from tracebacks in REPL (GH-122528) #122816
- [3.13] gh-122478: Remove internal frames from tracebacks in REPL (GH-122528) #122817
- [3.13] gh-122478: Remove internal frames from tracebacks in REPL (GH-122528) #123227