Skip to content

Commit c0f35c4

Browse files
Update run.py
1 parent a6316b0 commit c0f35c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/idlelib/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def show_socket_error(err, address):
230230

231231
def get_message_lines(typ, exc, tb):
232232
"Return line composing the exception message."
233-
if typ in (AttributeError, NameError):
233+
if typ in (AttributeError, NameError, ImportError):
234234
# 3.10+ hints are not directly accessible from python (#44026).
235235
err = io.StringIO()
236236
with contextlib.redirect_stderr(err):
@@ -243,7 +243,7 @@ def get_message_lines(typ, exc, tb):
243243
else:
244244
err_list = err_list[i:-1]
245245
break
246-
return ["\n".join(err_list) + "\n"]
246+
return ["\n".join(err_list) + "\n"] # The unmerged gh-135511
247247
else:
248248
return traceback.format_exception_only(typ, exc)
249249

0 commit comments

Comments
 (0)