Issue #25802: Deprecate load_module() on importlib.machinery.SourceFileLoader and SourcelessFileLoader.
They were the only remaining implementations of load_module() not documented as deprecated.
This commit is contained in:
parent
53d1f24408
commit
eae3079041
|
@ -921,6 +921,10 @@ 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
|
||||
|
||||
Use :meth:`importlib.abc.Loader.exec_module` instead.
|
||||
|
||||
|
||||
.. class:: SourcelessFileLoader(fullname, path)
|
||||
|
||||
|
@ -960,6 +964,10 @@ 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
|
||||
|
||||
Use :meth:`importlib.abc.Loader.exec_module` instead.
|
||||
|
||||
|
||||
.. class:: ExtensionFileLoader(fullname, path)
|
||||
|
||||
|
|
|
@ -189,7 +189,12 @@ become proper keywords in Python 3.7.
|
|||
Deprecated Python modules, functions and methods
|
||||
------------------------------------------------
|
||||
|
||||
* None yet.
|
||||
* :meth:`importlib.machinery.SourceFileLoader` and
|
||||
:meth:`importlib.machinery.SourcelessFileLoader` are now deprecated. They
|
||||
were the only remaining implementations of
|
||||
:meth:`importlib.abc.Loader.load_module` in :mod:`importlib` that had not
|
||||
been deprecated in previous versions of Python in favour of
|
||||
:meth:`importlib.abc.Loader.exec_module`.
|
||||
|
||||
|
||||
Deprecated functions and types of the C API
|
||||
|
|
|
@ -655,6 +655,7 @@ class _LoaderBasics:
|
|||
_bootstrap._call_with_frames_removed(exec, code, module.__dict__)
|
||||
|
||||
def load_module(self, fullname):
|
||||
"""This module is deprecated."""
|
||||
return _bootstrap._load_module_shim(self, fullname)
|
||||
|
||||
|
||||
|
|
|
@ -123,6 +123,9 @@ Core and Builtins
|
|||
Library
|
||||
-------
|
||||
|
||||
- Issue #25802: Document as deprecated the remaining implementations of
|
||||
importlib.abc.Loader.load_module().
|
||||
|
||||
- Issue #25928: Add Decimal.as_integer_ratio().
|
||||
|
||||
- Issue #25447: Copying the lru_cache() wrapper object now always works,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue