mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
bpo-42134: Raise ImportWarning when calling find_module() in the import system (GH-25044)
This commit is contained in:
parent
cf35e05f89
commit
a7ff6df60c
9 changed files with 1012 additions and 962 deletions
|
|
@ -329,6 +329,10 @@ modules, and one that knows how to import modules from an :term:`import path`
|
|||
import machinery will try it only if the finder does not implement
|
||||
``find_spec()``.
|
||||
|
||||
.. versionchanged:: 3.10
|
||||
Use of :meth:`~importlib.abc.MetaPathFinder.find_module` by the import system
|
||||
now raises :exc:`ImportWarning`.
|
||||
|
||||
|
||||
Loading
|
||||
=======
|
||||
|
|
@ -470,6 +474,9 @@ import machinery will create the new module itself.
|
|||
An :exc:`ImportError` is raised when ``exec_module()`` is defined but
|
||||
``create_module()`` is not.
|
||||
|
||||
.. versionchanged:: 3.10
|
||||
Use of ``load_module()`` will raise :exc:`ImportWarning`.
|
||||
|
||||
Submodules
|
||||
----------
|
||||
|
||||
|
|
@ -896,6 +903,10 @@ a list containing the portion.
|
|||
exist on a path entry finder, the import system will always call
|
||||
``find_loader()`` in preference to ``find_module()``.
|
||||
|
||||
.. versionchanged:: 3.10
|
||||
Calls to :meth:`~importlib.abc.PathEntryFinder.find_module` by the import
|
||||
system will raise :exc:`ImportWarning`.
|
||||
|
||||
|
||||
Replacing the standard import system
|
||||
====================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue