-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The new REPL outputs different tracebeck when custom sys.excepthook is used #122478
Comments
And for compile-time errors: >>> ?
File "<unknown>", line 1
?
^
SyntaxError: invalid syntax
>>> import sys; sys.excepthook = lambda *args: sys.__excepthook__(*args)
>>> ?
Traceback (most recent call last):
File "/home/serhiy/py/cpython/Lib/_pyrepl/console.py", line 172, in runsource
tree = ast.parse(source)
File "/home/serhiy/py/cpython/Lib/ast.py", line 53, in parse
return compile(source, filename, mode, flags,
_feature_version=feature_version, optimize=optimize)
File "<unknown>", line 1
?
^
SyntaxError: invalid syntax |
Seems to be done on purpose in Lines 126 to 132 in bd3d31f
I suppose this could be overridden in _pyrepl to always output with |
Frames of methods in code and codeop modules was show with non-default sys.excepthook. Save correct tracebacks in sys.last_traceback and update __traceback__ attribute of sys.last_value and sys.last_exc.
Frames of methods in code and codeop modules was show with non-default sys.excepthook. Save correct tracebacks in sys.last_traceback and update __traceback__ attribute of sys.last_value and sys.last_exc.
|
Frames of methods in code and codeop modules was show with non-default sys.excepthook. Save correct tracebacks in sys.last_traceback and update __traceback__ attribute of sys.last_value and sys.last_exc.
pythonGH-122528) Frames of methods in code and codeop modules was show with non-default sys.excepthook. Save correct tracebacks in sys.last_traceback and update __traceback__ attribute of sys.last_value and sys.last_exc. (cherry picked from commit e73e7a7) Co-authored-by: Serhiy Storchaka <[email protected]>
…onGH-122528) Frames of methods in code and codeop modules was show with non-default sys.excepthook. Save correct tracebacks in sys.last_traceback and update __traceback__ attribute of sys.last_value and sys.last_exc. (cherry picked from commit e73e7a7) Co-authored-by: Serhiy Storchaka <[email protected]>
…onGH-122528) Frames of methods in code and codeop modules was show with non-default sys.excepthook. Save correct tracebacks in sys.last_traceback and update __traceback__ attribute of sys.last_value and sys.last_exc.
pythonGH-122528) Frames of methods in code and codeop modules was show with non-default sys.excepthook. Save correct tracebacks in sys.last_traceback and update __traceback__ attribute of sys.last_value and sys.last_exc. (cherry picked from commit e73e7a7) Co-authored-by: Serhiy Storchaka <[email protected]>
pythonGH-122528) Frames of methods in code and codeop modules was show with non-default sys.excepthook. Save correct tracebacks in sys.last_traceback and update __traceback__ attribute of sys.last_value and sys.last_exc. (cherry picked from commit e73e7a7) Co-authored-by: Serhiy Storchaka <[email protected]>
…122528) (#123227) Frames of methods in code and codeop modules was show with non-default sys.excepthook. Save correct tracebacks in sys.last_traceback and update __traceback__ attribute of sys.last_value and sys.last_exc. (cherry picked from commit e73e7a7) Co-authored-by: Serhiy Storchaka <[email protected]>
Bug report
If
sys.systemhook
is notsys.__systemhook__
, the new REPL outputs the line in the code module in the traceback:Linked PRs
The text was updated successfully, but these errors were encountered: