Skip to content

Commit 0751511

Browse files
hugovkjaraco
andauthored
gh-93963: Remove deprecated names from importlib.abc (#119720)
Co-authored-by: Jason R. Coombs <[email protected]>
1 parent c8b45a3 commit 0751511

File tree

3 files changed

+26
-25
lines changed

3 files changed

+26
-25
lines changed

Doc/whatsnew/3.14.rst

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ ast
9090
---
9191

9292
Added :func:`ast.compare` for comparing two ASTs.
93-
(Contributed by Batuhan Taskaya and Jeremy Hylton in :issue:`15987`)
93+
(Contributed by Batuhan Taskaya and Jeremy Hylton in :issue:`15987`.)
9494

9595

9696

@@ -108,6 +108,13 @@ Deprecated
108108
Removed
109109
=======
110110

111+
argparse
112+
--------
113+
114+
* Remove the *type*, *choices*, and *metavar* parameters
115+
of :class:`!argparse.BooleanOptionalAction`.
116+
They were deprecated since 3.12.
117+
111118
ast
112119
---
113120

@@ -137,27 +144,34 @@ ast
137144

138145
(Contributed by Alex Waygood in :gh:`119562`.)
139146

140-
141-
argparse
142-
--------
143-
144-
* Remove the *type*, *choices*, and *metavar* parameters
145-
of :class:`!argparse.BooleanOptionalAction`.
146-
They were deprecated since 3.12.
147-
148147
collections.abc
149148
---------------
150149

151150
* Remove :class:`!collections.abc.ByteString`. It had previously raised a
152151
:exc:`DeprecationWarning` since Python 3.12.
153152

154-
155153
email
156154
-----
157155

158156
* Remove the *isdst* parameter from :func:`email.utils.localtime`.
159157
(Contributed by Hugo van Kemenade in :gh:`118798`.)
160158

159+
importlib
160+
---------
161+
162+
* Remove deprecated :mod:`importlib.abc` classes:
163+
164+
* :class:`!importlib.abc.ResourceReader`
165+
* :class:`!importlib.abc.Traversable`
166+
* :class:`!importlib.abc.TraversableResources`
167+
168+
Use :mod:`importlib.resources.abc` classes instead:
169+
170+
* :class:`importlib.resources.abc.Traversable`
171+
* :class:`importlib.resources.abc.TraversableResources`
172+
173+
(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)
174+
161175
itertools
162176
---------
163177

Lib/importlib/abc.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
import abc
1616
import warnings
1717

18-
from .resources import abc as _resources_abc
19-
2018

2119
__all__ = [
2220
'Loader', 'MetaPathFinder', 'PathEntryFinder',
@@ -25,19 +23,6 @@
2523
]
2624

2725

28-
def __getattr__(name):
29-
"""
30-
For backwards compatibility, continue to make names
31-
from _resources_abc available through this module. #93963
32-
"""
33-
if name in _resources_abc.__all__:
34-
obj = getattr(_resources_abc, name)
35-
warnings._deprecated(f"{__name__}.{name}", remove=(3, 14))
36-
globals()[name] = obj
37-
return obj
38-
raise AttributeError(f'module {__name__!r} has no attribute {name!r}')
39-
40-
4126
def _register(abstract_cls, *classes):
4227
for cls in classes:
4328
abstract_cls.register(cls)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Remove deprecated names from ``importlib.abc`` as found in
2+
``importlib.resources.abc``.

0 commit comments

Comments
 (0)