Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit96a6ee0

Browse files
authored
[3.12]gh-97850: Update the deprecation warning ofimportlib.abc.Loader.load_module (GH-129855) (GH-130017)
(cherry picked from commitaa81a6f)
1 parentc62d573 commit96a6ee0

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Pending Removal in Python 3.15
66
rarely used. No direct replacement exists. *Anything* is better than CGI
77
to interface a web server with a request handler.
88

9+
*:mod:`importlib`:
10+
11+
* ``load_module()`` method: use ``exec_module()`` instead.
12+
913
*:class:`locale`::func:`locale.getdefaultlocale` was deprecated in Python 3.11
1014
and originally planned for removal in Python 3.13 (:gh:`90817`),
1115
but removal has been postponed to Python 3.15.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ although there is currently no date scheduled for their removal.
5757

5858
*:mod:`importlib`:
5959

60-
* ``load_module()`` method: use ``exec_module()`` instead.
6160
*:func:`~importlib.util.cache_from_source` *debug_override* parameter is
6261
deprecated: use the *optimization* parameter instead.
6362

‎Doc/library/importlib.rst

Lines 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

Lines 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
iffullnameinsys.modules:
Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp