]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-97850: Update the deprecation warning of `importlib.abc.Loader.load_module...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 11 Feb 2025 19:28:25 +0000 (20:28 +0100)
committerGitHub <noreply@github.com>
Tue, 11 Feb 2025 19:28:25 +0000 (19:28 +0000)
gh-97850: Update the deprecation warning of `importlib.abc.Loader.load_module` (GH-129855)
(cherry picked from commit aa81a6f6e4f265565da9781d0bf95c7d16ddd961)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Doc/deprecations/pending-removal-in-3.15.rst
Doc/deprecations/pending-removal-in-future.rst
Doc/library/importlib.rst
Lib/importlib/_bootstrap.py
Misc/NEWS.d/next/Library/2025-02-08-15-13-43.gh-issue-97850.jQ0CvW.rst [new file with mode: 0644]

index f0b184b6c804cd537f1474ca475dafd09f18d1d2..7e63567ce2ec0fd914f6ccb7a84b7220fff92ba8 100644 (file)
@@ -29,6 +29,10 @@ Pending Removal in Python 3.15
   * The :option:`!--cgi` flag to the :program:`python -m http.server`
     command-line interface has been deprecated since Python 3.13.
 
+* :mod:`importlib`:
+
+  * ``load_module()`` method: use ``exec_module()`` instead.
+
 * :class:`locale`:
 
   * The :func:`~locale.getdefaultlocale` function
index 3f9cf6f208221ab87aee082bf6a8ac1c5c6f1634..fdca65c341209dd2b9925af5c66e5aa130531a18 100644 (file)
@@ -57,7 +57,6 @@ although there is currently no date scheduled for their removal.
 
 * :mod:`importlib`:
 
-  * ``load_module()`` method: use ``exec_module()`` instead.
   * :func:`~importlib.util.cache_from_source` *debug_override* parameter is
     deprecated: use the *optimization* parameter instead.
 
index 3d56ebd75771ee2b5f75dc6a4fe86e7c576d0e12..93da427bfc5abb492a159b960a953ad1ebc62cb4 100644 (file)
@@ -370,7 +370,7 @@ ABC hierarchy::
            :exc:`NotImplementedError`.  Functionality provided when
            :meth:`exec_module` is available.
 
-        .. deprecated:: 3.4
+        .. deprecated-removed:: 3.4 3.15
            The recommended API for loading a module is :meth:`exec_module`
            (and :meth:`create_module`).  Loaders should implement it instead of
            :meth:`load_module`.  The import machinery takes care of all the
@@ -474,7 +474,7 @@ ABC hierarchy::
 
        Implementation of :meth:`Loader.load_module`.
 
-       .. deprecated:: 3.4
+       .. deprecated-removed:: 3.4 3.15
           use :meth:`exec_module` instead.
 
 
@@ -521,7 +521,7 @@ ABC hierarchy::
 
       Calls super's ``load_module()``.
 
-      .. deprecated:: 3.4
+      .. deprecated-removed:: 3.4 3.15
          Use :meth:`Loader.exec_module` instead.
 
    .. abstractmethod:: get_filename(fullname)
@@ -610,7 +610,7 @@ ABC hierarchy::
 
        Concrete implementation of :meth:`Loader.load_module`.
 
-       .. deprecated:: 3.4
+       .. deprecated-removed:: 3.4 3.15
           Use :meth:`exec_module` instead.
 
     .. method:: get_source(fullname)
@@ -1020,7 +1020,7 @@ find and load modules.
       Concrete implementation of :meth:`importlib.abc.Loader.load_module` where
       specifying the name of the module to load is optional.
 
-      .. deprecated:: 3.6
+      .. deprecated-removed:: 3.6 3.15
 
          Use :meth:`importlib.abc.Loader.exec_module` instead.
 
@@ -1063,7 +1063,7 @@ find and load modules.
    Concrete implementation of :meth:`importlib.abc.Loader.load_module` where
    specifying the name of the module to load is optional.
 
-   .. deprecated:: 3.6
+   .. deprecated-removed:: 3.6 3.15
 
       Use :meth:`importlib.abc.Loader.exec_module` instead.
 
index de5651f0a7fc36121574e925ac3bfc8496ec97b9..23cad8c5dc1291dc947af42aac754ae558770108 100644 (file)
@@ -526,7 +526,7 @@ def _load_module_shim(self, fullname):
 
     """
     msg = ("the load_module() method is deprecated and slated for removal in "
-          "Python 3.12; use exec_module() instead")
+           "Python 3.15; use exec_module() instead")
     _warnings.warn(msg, DeprecationWarning)
     spec = spec_from_loader(fullname, self)
     if fullname in sys.modules:
diff --git a/Misc/NEWS.d/next/Library/2025-02-08-15-13-43.gh-issue-97850.jQ0CvW.rst b/Misc/NEWS.d/next/Library/2025-02-08-15-13-43.gh-issue-97850.jQ0CvW.rst
new file mode 100644 (file)
index 0000000..7b29ffe
--- /dev/null
@@ -0,0 +1,2 @@
+Update the deprecation warning of
+:meth:`importlib.abc.Loader.load_module`.