Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-132385: Fix instance error suggestions potential exceptions intraceback
#132387
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Lib/traceback.py Outdated
if hasattr(self, wrong_name): | ||
try: | ||
has_wrong_name = hasattr(self, wrong_name) | ||
except BaseException: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This can swallow things like KeyboardInterrupt and MemoryError. We shouldn't do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
ThenException
only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Would that catch SystemExit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
No :)
>>>SystemExit.__mro__(<class'SystemExit'>,<class'BaseException'>,<class'object'>)
After this change: 2025-04-11.13.45.38.mov |
Uh oh!
There was an error while loading.Please reload this page.
@iritkatriel thank you! |
641253c
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…eptions in `traceback` (pythonGH-132387)(cherry picked from commit641253c)Co-authored-by: sobolevn <mail@sobolevn.me>
GH-133297 is a backport of this pull request to the3.13 branch. |
Uh oh!
There was an error while loading.Please reload this page.
It does not cover all side-effects, it will still evaluate
print
, etc.But, it does not fail with exceptions at least.
__getattr__
#132385