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-143811: Add helpful default error messages to AttributeError and NameError #143813

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

Open
johnslavik wants to merge 3 commits into python:main
base: main
Choose a base branch
Loading
from johnslavik:add-default-messages-attributeerror-nameerror

Conversation

@johnslavik
Copy link
Member

@johnslavik johnslavik commented Jan 13, 2026
edited
Loading

Comment on lines 1140 to 1141
wrong_name = getattr(exc_value, "name", None)
if wrong_name is not None and wrong_name in sys.stdlib_module_names:
Copy link
Member Author

@johnslavik johnslavik Jan 13, 2026
edited
Loading

Choose a reason for hiding this comment

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

Out of scope, within the same function: wrong_name = ... and wrong_name is not None and could be removed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iritkatriel iritkatriel Awaiting requested review from iritkatriel iritkatriel is a code owner

@a12k a12k Awaiting requested review from a12k

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /