summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2021-04-02 19:35:32 (GMT)
committerGitHub <noreply@github.com>2021-04-02 19:35:32 (GMT)
commitf97dc800689ba98783dac8dc51f87f7c6f413ac6 (patch)
treee51ae8f2bf8b3f5434ab4d8b37cd0eef87b62c4e /Doc
parentad442a674ca443feec43a88a2d3671784712e550 (diff)
downloadcpython-f97dc800689ba98783dac8dc51f87f7c6f413ac6.zip
cpython-f97dc800689ba98783dac8dc51f87f7c6f413ac6.tar.gz
cpython-f97dc800689ba98783dac8dc51f87f7c6f413ac6.tar.bz2
bpo-43672: raise ImportWarning when calling find_loader() (GH-25119)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/reference/import.rst3
-rw-r--r--Doc/whatsnew/3.10.rst8
2 files changed, 9 insertions, 2 deletions
diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst
index 5d2169b..2ef5b90 100644
--- a/Doc/reference/import.rst
+++ b/Doc/reference/import.rst
@@ -904,7 +904,8 @@ a list containing the portion.
``find_loader()`` in preference to ``find_module()``.
.. versionchanged:: 3.10
- Calls to :meth:`~importlib.abc.PathEntryFinder.find_module` by the import
+ Calls to :meth:`~importlib.abc.PathEntryFinder.find_module` and
+ :meth:`~importlib.abc.PathEntryFinder.find_loader` by the import
system will raise :exc:`ImportWarning`.
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index eb42480..d20fdac 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -1050,7 +1050,13 @@ Deprecated
:meth:`importlib.abc.PathEntryFinder.find_spec`
are preferred, respectively. You can use
:func:`importlib.util.spec_from_loader` to help in porting.
- (Contributed by Brett Cannon in :issue:`42134`.)
+ (Contributed by Brett Cannon in :issue:`42134`.)
+
+* The use of :meth:`importlib.abc.PathEntryFinder.find_loader` by the import
+ system now triggers an :exc:`ImportWarning` as
+ :meth:`importlib.abc.PathEntryFinder.find_spec` is preferred. You can use
+ :func:`importlib.util.spec_from_loader` to help in porting.
+ (Contributed by Brett Cannon in :issue:`43672`.)
* The import system now uses the ``__spec__`` attribute on modules before
falling back on :meth:`~importlib.abc.Loader.module_repr` for a module's