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>
This commit is contained in:
Thomas Grainger 2022-02-23 00:25:00 +00:00 committed by GitHub
parent 1f455361ec
commit 9b12b1b803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 3 deletions

View File

@ -312,7 +312,7 @@ def __getattr__(name):
global OpenWrapper
OpenWrapper = open
return OpenWrapper
raise AttributeError(name)
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
# In normal operation, both `UnsupportedOperation`s should be bound to the

View File

@ -50,4 +50,4 @@ def __getattr__(name):
ThreadPoolExecutor = te
return te
raise AttributeError(f"module {__name__} has no attribute {name}")
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

View File

@ -70,7 +70,7 @@ def __getattr__(name):
global OpenWrapper
OpenWrapper = open
return OpenWrapper
raise AttributeError(name)
raise AttributeError("module {__name__!r} has no attribute {name!r}")
# Pretend this exception was created here.

View File

@ -0,0 +1 @@
Make various module ``__getattr__`` AttributeErrors more closely match a typical AttributeError