Skip to content

Commit 99b0a6d

Browse files
committed
fix io AttributeError message
1 parent 654d472 commit 99b0a6d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/_pyio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def __getattr__(name):
312312
global OpenWrapper
313313
OpenWrapper = open
314314
return OpenWrapper
315-
raise AttributeError(name)
315+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
316316

317317

318318
# In normal operation, both `UnsupportedOperation`s should be bound to the

Lib/io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __getattr__(name):
7070
global OpenWrapper
7171
OpenWrapper = open
7272
return OpenWrapper
73-
raise AttributeError(name)
73+
raise AttributeError("module {__name__!r} has no attribute {name!r}")
7474

7575

7676
# Pretend this exception was created here.

0 commit comments

Comments
 (0)