Skip to content

Commit

Permalink
Use 'warnings._deprecated'. Fixes #93963 until Python π.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jul 3, 2022
1 parent 63c3c76 commit 8525926
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Lib/importlib/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,11 @@
def __getattr__(name, canonical=_resources_abc):
"""
For backwards compatibility, continue to make names
from canonical available through this module.
from canonical available through this module. #93963
"""
if name in canonical.__all__:
obj = getattr(canonical, name)
import warnings
warnings.warn(
f"Using or importing the ABCs from {__name__!r} instead "
f"of from {canonical.__name__!r} is now deprecated, "
"scheduled for removal in Python 3.13",
DeprecationWarning,
stacklevel=2,
)
warnings._deprecated(__name__, remove=(3, 14))
globals()[name] = obj
return obj
raise AttributeError(f'module {__name__!r} has no attribute {name!r}')
Expand Down

0 comments on commit 8525926

Please sign in to comment.