Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aa81a6f

Browse filesBrowse files
authored
gh-97850: Update the deprecation warning of importlib.abc.Loader.load_module (GH-129855)
1 parent 5cdd6e5 commit aa81a6f
Copy full SHA for aa81a6f

File tree

5 files changed

+13
-8
lines changed
Filter options

5 files changed

+13
-8
lines changed

‎Doc/deprecations/pending-removal-in-3.15.rst

Copy file name to clipboardExpand all lines: Doc/deprecations/pending-removal-in-3.15.rst
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Pending removal in Python 3.15
2929
* The :option:`!--cgi` flag to the :program:`python -m http.server`
3030
command-line interface has been deprecated since Python 3.13.
3131

32+
* :mod:`importlib`:
33+
34+
* ``load_module()`` method: use ``exec_module()`` instead.
35+
3236
* :class:`locale`:
3337

3438
* The :func:`~locale.getdefaultlocale` function

‎Doc/deprecations/pending-removal-in-future.rst

Copy file name to clipboardExpand all lines: Doc/deprecations/pending-removal-in-future.rst
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ although there is currently no date scheduled for their removal.
6363

6464
* :mod:`importlib`:
6565

66-
* ``load_module()`` method: use ``exec_module()`` instead.
6766
* :func:`~importlib.util.cache_from_source` *debug_override* parameter is
6867
deprecated: use the *optimization* parameter instead.
6968

‎Doc/library/importlib.rst

Copy file name to clipboardExpand all lines: Doc/library/importlib.rst
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ ABC hierarchy::
370370
:exc:`NotImplementedError`. Functionality provided when
371371
:meth:`exec_module` is available.
372372

373-
.. deprecated:: 3.4
373+
.. deprecated-removed:: 3.4 3.15
374374
The recommended API for loading a module is :meth:`exec_module`
375375
(and :meth:`create_module`). Loaders should implement it instead of
376376
:meth:`load_module`. The import machinery takes care of all the
@@ -474,7 +474,7 @@ ABC hierarchy::
474474

475475
Implementation of :meth:`Loader.load_module`.
476476

477-
.. deprecated:: 3.4
477+
.. deprecated-removed:: 3.4 3.15
478478
use :meth:`exec_module` instead.
479479

480480

@@ -521,7 +521,7 @@ ABC hierarchy::
521521

522522
Calls super's ``load_module()``.
523523

524-
.. deprecated:: 3.4
524+
.. deprecated-removed:: 3.4 3.15
525525
Use :meth:`Loader.exec_module` instead.
526526

527527
.. abstractmethod:: get_filename(fullname)
@@ -610,7 +610,7 @@ ABC hierarchy::
610610

611611
Concrete implementation of :meth:`Loader.load_module`.
612612

613-
.. deprecated:: 3.4
613+
.. deprecated-removed:: 3.4 3.15
614614
Use :meth:`exec_module` instead.
615615

616616
.. method:: get_source(fullname)
@@ -1020,7 +1020,7 @@ find and load modules.
10201020
Concrete implementation of :meth:`importlib.abc.Loader.load_module` where
10211021
specifying the name of the module to load is optional.
10221022

1023-
.. deprecated:: 3.6
1023+
.. deprecated-removed:: 3.6 3.15
10241024

10251025
Use :meth:`importlib.abc.Loader.exec_module` instead.
10261026

@@ -1063,7 +1063,7 @@ find and load modules.
10631063
Concrete implementation of :meth:`importlib.abc.Loader.load_module` where
10641064
specifying the name of the module to load is optional.
10651065

1066-
.. deprecated:: 3.6
1066+
.. deprecated-removed:: 3.6 3.15
10671067

10681068
Use :meth:`importlib.abc.Loader.exec_module` instead.
10691069

‎Lib/importlib/_bootstrap.py

Copy file name to clipboardExpand all lines: Lib/importlib/_bootstrap.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ def _load_module_shim(self, fullname):
526526
527527
"""
528528
msg = ("the load_module() method is deprecated and slated for removal in "
529-
"Python 3.12; use exec_module() instead")
529+
"Python 3.15; use exec_module() instead")
530530
_warnings.warn(msg, DeprecationWarning)
531531
spec = spec_from_loader(fullname, self)
532532
if fullname in sys.modules:
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Update the deprecation warning of
2+
:meth:`importlib.abc.Loader.load_module`.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.