Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
sobolevn merged 2 commits intopython:mainfromsobolevn:issue-132385
May 2, 2025

Conversation

sobolevn
Copy link
Member

@sobolevnsobolevn commentedApr 11, 2025
edited by bedevere-appbot
Loading

It does not cover all side-effects, it will still evaluateprint, etc.
But, it does not fail with exceptions at least.

if hasattr(self, wrong_name):
try:
has_wrong_name = hasattr(self, wrong_name)
except BaseException:
Copy link
Member

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.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

ThenException only?

Copy link
Member

Choose a reason for hiding this comment

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

Would that catch SystemExit?

Copy link
MemberAuthor

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
Copy link
MemberAuthor

After this change:

2025-04-11.13.45.38.mov

@sobolevnsobolevn requested a review fromiritkatrielMay 1, 2025 18:02
@sobolevn
Copy link
MemberAuthor

@iritkatriel thank you!

@sobolevnsobolevn merged commit641253c intopython:mainMay 2, 2025
45 checks passed
@miss-islington-app
Copy link

Thanks@sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 2, 2025
…eptions in `traceback` (pythonGH-132387)(cherry picked from commit641253c)Co-authored-by: sobolevn <mail@sobolevn.me>
@bedevere-app
Copy link

GH-133297 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelMay 2, 2025
sobolevn added a commit that referenced this pull requestMay 2, 2025
…ceptions in `traceback` (GH-132387) (#133297)gh-132385: Fix instance error suggestions trigger potential exceptions in `traceback` (GH-132387)(cherry picked from commit641253c)Co-authored-by: sobolevn <mail@sobolevn.me>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@iritkatrieliritkatrieliritkatriel approved these changes

@pablogsalpablogsalAwaiting requested review from pablogsal

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@sobolevn@iritkatriel@pablogsal

[8]ページ先頭

©2009-2025 Movatter.jp