Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
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
| ifhasattr(self,wrong_name): | ||
| try: | ||
| has_wrong_name=hasattr(self,wrong_name) | ||
| exceptBaseException: |
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'>)
sobolevn commentedApr 11, 2025
After this change: 2025-04-11.13.45.38.mov |
Uh oh!
There was an error while loading.Please reload this page.
sobolevn commentedMay 2, 2025
@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. |
…eptions in `traceback` (python#132387)
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