mirror of https://github.com/python/cpython
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
|
@ -90,7 +90,7 @@ ast
|
||||||
---
|
---
|
||||||
|
|
||||||
Added :func:`ast.compare` for comparing two ASTs.
|
Added :func:`ast.compare` for comparing two ASTs.
|
||||||
(Contributed by Batuhan Taskaya and Jeremy Hylton in :issue:`15987`)
|
(Contributed by Batuhan Taskaya and Jeremy Hylton in :issue:`15987`.)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,6 +108,13 @@ Deprecated
|
||||||
Removed
|
Removed
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
argparse
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Remove the *type*, *choices*, and *metavar* parameters
|
||||||
|
of :class:`!argparse.BooleanOptionalAction`.
|
||||||
|
They were deprecated since 3.12.
|
||||||
|
|
||||||
ast
|
ast
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -137,27 +144,34 @@ ast
|
||||||
|
|
||||||
(Contributed by Alex Waygood in :gh:`119562`.)
|
(Contributed by Alex Waygood in :gh:`119562`.)
|
||||||
|
|
||||||
|
|
||||||
argparse
|
|
||||||
--------
|
|
||||||
|
|
||||||
* Remove the *type*, *choices*, and *metavar* parameters
|
|
||||||
of :class:`!argparse.BooleanOptionalAction`.
|
|
||||||
They were deprecated since 3.12.
|
|
||||||
|
|
||||||
collections.abc
|
collections.abc
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
* Remove :class:`!collections.abc.ByteString`. It had previously raised a
|
* Remove :class:`!collections.abc.ByteString`. It had previously raised a
|
||||||
:exc:`DeprecationWarning` since Python 3.12.
|
:exc:`DeprecationWarning` since Python 3.12.
|
||||||
|
|
||||||
|
|
||||||
email
|
email
|
||||||
-----
|
-----
|
||||||
|
|
||||||
* Remove the *isdst* parameter from :func:`email.utils.localtime`.
|
* Remove the *isdst* parameter from :func:`email.utils.localtime`.
|
||||||
(Contributed by Hugo van Kemenade in :gh:`118798`.)
|
(Contributed by Hugo van Kemenade in :gh:`118798`.)
|
||||||
|
|
||||||
|
importlib
|
||||||
|
---------
|
||||||
|
|
||||||
|
* Remove deprecated :mod:`importlib.abc` classes:
|
||||||
|
|
||||||
|
* :class:`!importlib.abc.ResourceReader`
|
||||||
|
* :class:`!importlib.abc.Traversable`
|
||||||
|
* :class:`!importlib.abc.TraversableResources`
|
||||||
|
|
||||||
|
Use :mod:`importlib.resources.abc` classes instead:
|
||||||
|
|
||||||
|
* :class:`importlib.resources.abc.Traversable`
|
||||||
|
* :class:`importlib.resources.abc.TraversableResources`
|
||||||
|
|
||||||
|
(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)
|
||||||
|
|
||||||
itertools
|
itertools
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,6 @@ from ._abc import Loader
|
||||||
import abc
|
import abc
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from .resources import abc as _resources_abc
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'Loader', 'MetaPathFinder', 'PathEntryFinder',
|
'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):
|
def _register(abstract_cls, *classes):
|
||||||
for cls in classes:
|
for cls in classes:
|
||||||
abstract_cls.register(cls)
|
abstract_cls.register(cls)
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Remove deprecated names from ``importlib.abc`` as found in
|
||||||
|
``importlib.resources.abc``.
|
Loading…
Reference in New Issue