Skip to content

Commit c0d91af

Browse files
committed
Upgrade the imp module's deprecation to DeprecationWarning.
1 parent aa15ea4 commit c0d91af

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

Doc/whatsnew/3.6.rst

+3
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ Changes in the Python API
228228
now raises :exc:`ValueError` for out-of-range values, rather than
229229
returning :const:`None`. See :issue:`20059`.
230230

231+
* The :mod:`imp` module now raises a :exc:`DeprecationWarning` instead of
232+
:exc:`PendingDeprecationWarning`.
233+
231234

232235
Changes in the C API
233236
--------------------

Lib/imp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
warnings.warn("the imp module is deprecated in favour of importlib; "
3232
"see the module's documentation for alternative uses",
33-
PendingDeprecationWarning, stacklevel=2)
33+
DeprecationWarning, stacklevel=2)
3434

3535
# DEPRECATED
3636
SEARCH_ERROR = 0

Lib/pkgutil.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def _iter_file_finder_modules(importer, prefix=''):
180180
def _import_imp():
181181
global imp
182182
with warnings.catch_warnings():
183-
warnings.simplefilter('ignore', PendingDeprecationWarning)
183+
warnings.simplefilter('ignore', DeprecationWarning)
184184
imp = importlib.import_module('imp')
185185

186186
class ImpImporter:

Misc/NEWS

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Core and Builtins
6363
Library
6464
-------
6565

66+
- Move the imp module from a PendingDeprecationWarning to DeprecationWarning.
67+
6668
- Issue #25407: Remove mentions of the formatter module being removed in
6769
Python 3.6.
6870

0 commit comments

Comments
 (0)