8000 gh-135511 Fixed `NameError` and `AttributeError` lack of the message in IDLE by Locked-chess-official · Pull Request #135526 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-135511 Fixed NameError and AttributeError lack of the message in IDLE #135526

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
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update run.py
  • Loading branch information
Locked-chess-official authored Jun 15, 2025
commit 465097b0c3087e24a7c890cfc76b1eb0043711d8
2 changes: 1 addition & 1 deletion Lib/idlelib/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def print_exc(typ, exc, tb):
cleanup_traceback(tbe, exclude)
traceback.print_list(tbe, file=efile)
if ((not isinstance(exc, NameError) and not isinstance(exc, AttributeError))
or "\n" in str(exc)):
or "\n" not in str(exc)):
lines = get_message_lines(typ, exc, tb)
else: # User-created Name/AttributeError with multiline message, GH-135511.
lines = [f"{typ.__name__}: {str(exc)}"]
Expand Down
Loading
0