]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-93963: Remove deprecated names from importlib.abc (#119720)
authorHugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Wed, 29 May 2024 17:08:27 +0000 (20:08 +0300)
committerGitHub <noreply@github.com>
Wed, 29 May 2024 17:08:27 +0000 (11:08 -0600)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Doc/whatsnew/3.14.rst
Lib/importlib/abc.py
Misc/NEWS.d/next/Library/2024-05-29-12-42-40.gh-issue-93963.cb1oJS.rst [new file with mode: 0644]

index bc7fe64e68bb1891999d441803d70ff2616bdfe3..8c37825430c2cf2fd320d4a6b2cb9768fd22c2f6 100644 (file)
@@ -90,7 +90,7 @@ ast
 ---
 
 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
 =======
 
+argparse
+--------
+
+* Remove the *type*, *choices*, and *metavar* parameters
+  of :class:`!argparse.BooleanOptionalAction`.
+  They were deprecated since 3.12.
+
 ast
 ---
 
@@ -137,27 +144,34 @@ ast
 
   (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
 ---------------
 
 * Remove :class:`!collections.abc.ByteString`. It had previously raised a
   :exc:`DeprecationWarning` since Python 3.12.
 
-
 email
 -----
 
 * Remove the *isdst* parameter from :func:`email.utils.localtime`.
   (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
 ---------
 
index 37fef357fe2c0c76e818fff82b71cf9f0def317d..b6b2c791a3b03f929161d2a5c98d67ee40901a59 100644 (file)
@@ -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)
diff --git a/Misc/NEWS.d/next/Library/2024-05-29-12-42-40.gh-issue-93963.cb1oJS.rst b/Misc/NEWS.d/next/Library/2024-05-29-12-42-40.gh-issue-93963.cb1oJS.rst
new file mode 100644 (file)
index 0000000..d093c8e
--- /dev/null
@@ -0,0 +1,2 @@
+Remove deprecated names from ``importlib.abc`` as found in
+``importlib.resources.abc``.