mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
gh-93963: Remove deprecated names from importlib.abc (#119720)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
This commit is contained in:
parent
c8b45a385a
commit
0751511d24
3 changed files with 26 additions and 25 deletions
|
@ -15,8 +15,6 @@ from ._abc import Loader
|
|||
import abc
|
||||
import warnings
|
||||
|
||||
from .resources import abc as _resources_abc
|
||||
|
||||
|
||||
__all__ = [
|
||||
'Loader', 'MetaPathFinder', 'PathEntryFinder',
|
||||
|
@ -25,19 +23,6 @@ __all__ = [
|
|||
]
|
||||
|
||||
|
||||
def __getattr__(name):
|
||||
"""
|
||||
For backwards compatibility, continue to make names
|
||||
from _resources_abc available through this module. #93963
|
||||
"""
|
||||
if name in _resources_abc.__all__:
|
||||
obj = getattr(_resources_abc, name)
|
||||
warnings._deprecated(f"{__name__}.{name}", remove=(3, 14))
|
||||
globals()[name] = obj
|
||||
return obj
|
||||
raise AttributeError(f'module {__name__!r} has no attribute {name!r}')
|
||||
|
||||
|
||||
def _register(abstract_cls, *classes):
|
||||
for cls in classes:
|
||||
abstract_cls.register(cls)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue