Skip to content

Commit 9c4aaad

Browse files
Simplify exception message retrieval logic
1 parent a9b9589 commit 9c4aaad

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

Lib/idlelib/run.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,7 @@ def show_socket_error(err, address):
229229

230230
def get_message_lines(typ, exc, tb):
231231
"Return line composing the exception message."
232-
if typ in (AttributeError, NameError):
233-
# 3.10+ hints are not directly accessible from python (#44026).
234-
traceback_exception = traceback.TracebackException(typ, exc, tb)
235-
return list(traceback_exception.format_exception_only())
236-
else:
237-
return traceback.format_exception_only(typ, exc)
232+
return list(traceback.TracebackException(typ, exc, tb).format_exception_only())
238233

239234

240235
def print_exception():

0 commit comments

Comments
 (0)