Movatterモバイル変換


[0]ホーム

URL:


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

Commit9b12b1b

Browse files
graingertblurb-it[bot]asvetlov
authored
bpo-46522: fix concurrent.futures and io AttributeError messages (GH-30887)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
1 parent1f45536 commit9b12b1b

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
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
globalOpenWrapper
313313
OpenWrapper=open
314314
returnOpenWrapper
315-
raiseAttributeError(name)
315+
raiseAttributeError(f"module{__name__!r} has no attribute{name!r}")
316316

317317

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

‎Lib/concurrent/futures/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ def __getattr__(name):
5050
ThreadPoolExecutor=te
5151
returnte
5252

53-
raiseAttributeError(f"module{__name__} has no attribute{name}")
53+
raiseAttributeError(f"module{__name__!r} has no attribute{name!r}")

‎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
globalOpenWrapper
7171
OpenWrapper=open
7272
returnOpenWrapper
73-
raiseAttributeError(name)
73+
raiseAttributeError("module {__name__!r} has no attribute {name!r}")
7474

7575

7676
# Pretend this exception was created here.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make various module ``__getattr__`` AttributeErrors more closely match a typical AttributeError

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp