Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 62961dd

Browse files
committed
Issue #13959: Document imp.find_module/load_module as deprecated.
The code itself does not raise a DeprecationWarning as the functions are technically fine, it's just a bad API. Unfortunately experience has shown that the terrible API has been exposed in various places, necessitating that it stick around probably until py4k comes around since it is such a shift to move over to importlib.find_loader().
1 parent 401f9f3 commit 62961dd

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

Doc/library/imp.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ This module provides an interface to the mechanisms used to implement the
7272
then use :func:`find_module` with the *path* argument set to ``P.__path__``.
7373
When *P* itself has a dotted name, apply this recipe recursively.
7474

75+
.. deprecated:: 3.3
76+
Use :func:`importlib.find_loader` instead.
77+
7578

7679
.. function:: load_module(name, file, pathname, description)
7780

@@ -93,6 +96,10 @@ This module provides an interface to the mechanisms used to implement the
9396
it was not ``None``, even when an exception is raised. This is best done
9497
using a :keyword:`try` ... :keyword:`finally` statement.
9598

99+
.. deprecated:: 3.3
100+
Unneeded as loaders should be used to load modules and
101+
:func:`find_module` is deprecated.
102+
96103

97104
.. function:: new_module(name)
98105

Misc/NEWS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Library
2626
- Issue #14366: Support lzma compression in zip files.
2727
Patch by Serhiy Storchaka.
2828

29-
- Issue #13959: Introduce importlib.find_loader().
29+
- Issue #13959: Introduce importlib.find_loader() and document
30+
imp.find_module/load_module as deprecated.
3031

3132
- Issue #14082: shutil.copy2() now copies extended attributes, if possible.
3233
Patch by Hynek Schlawack.

0 commit comments

Comments
 (0)