Skip to content
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

[3.13] gh-122478: Remove internal frames from tracebacks in REPL (GH-122528) #122817

Closed

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Aug 8, 2024

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 storchaka@gmail.com

…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 <storchaka@gmail.com>
# over self.write
self._call_excepthook(type, value, tb)
try:
typ, value, tb = sys.exc_info()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These days we do exc = sys.exception() and then use exc.__traceback__ and type(exc).

Copy link
Contributor

@cfbolz cfbolz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@cfbolz
Copy link
Contributor

cfbolz commented Aug 23, 2024

backport happened in #123227

@cfbolz cfbolz closed this Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants