Skip to content

Commit 8525926

Browse files
committed
Use 'warnings._deprecated'. Fixes #93963 until Python π.
1 parent 63c3c76 commit 8525926

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

Lib/importlib/abc.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,11 @@
2828
def __getattr__(name, canonical=_resources_abc):
2929
"""
3030
For backwards compatibility, continue to make names
31-
from canonical available through this module.
31+
from canonical available through this module. #93963
3232
"""
3333
if name in canonical.__all__:
3434
obj = getattr(canonical, name)
35-
import warnings
36-
warnings.warn(
37-
f"Using or importing the ABCs from {__name__!r} instead "
38-
f"of from {canonical.__name__!r} is now deprecated, "
39-
"scheduled for removal in Python 3.13",
40-
DeprecationWarning,
41-
stacklevel=2,
42-
)
35+
warnings._deprecated(__name__, remove=(3, 14))
4336
globals()[name] = obj
4437
return obj
4538
raise AttributeError(f'module {__name__!r} has no attribute {name!r}')

0 commit comments

Comments
 (0)