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

[3.13] gh-97850: Update the deprecation warning of importlib.abc.Loader.load_module (GH-129855) #130013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-97850: Update the deprecation warning of `importlib.abc.Loader.loa…
…d_module` (GH-129855)

(cherry picked from commit aa81a6f)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
  • Loading branch information
tomasr8 authored and miss-islington committed Feb 11, 2025
commit 7d76b884c09012fd1b6e90d6444acb7bb0b4e3e8
4 changes: 4 additions & 0 deletions 4 Doc/deprecations/pending-removal-in-3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion 1 Doc/deprecations/pending-removal-in-future.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
12 changes: 6 additions & 6 deletions 12 Doc/library/importlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion 2 Lib/importlib/_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Update the deprecation warning of
:meth:`importlib.abc.Loader.load_module`.
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.