summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2015-10-16 19:21:37 (GMT)
committerBrett Cannon <brett@python.org>2015-10-16 19:21:37 (GMT)
commitc0d91aff9a3b91307b26e8b7c34dfbf27bbdd43a (patch)
tree160a62668441c5264ab0e27e9900094e3006bbd3
parentaa15ea4b4e15a5350c34fe1ef0b8761d92fd4688 (diff)
downloadcpython-c0d91aff9a3b91307b26e8b7c34dfbf27bbdd43a.zip
cpython-c0d91aff9a3b91307b26e8b7c34dfbf27bbdd43a.tar.gz
cpython-c0d91aff9a3b91307b26e8b7c34dfbf27bbdd43a.tar.bz2
Upgrade the imp module's deprecation to DeprecationWarning.
-rw-r--r--Doc/whatsnew/3.6.rst3
-rw-r--r--Lib/imp.py2
-rw-r--r--Lib/pkgutil.py2
-rw-r--r--Misc/NEWS2
4 files changed, 7 insertions, 2 deletions
diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
index edacea1..b374280 100644
--- a/Doc/whatsnew/3.6.rst
+++ b/Doc/whatsnew/3.6.rst
@@ -228,6 +228,9 @@ Changes in the Python API
now raises :exc:`ValueError` for out-of-range values, rather than
returning :const:`None`. See :issue:`20059`.
+* The :mod:`imp` module now raises a :exc:`DeprecationWarning` instead of
+ :exc:`PendingDeprecationWarning`.
+
Changes in the C API
--------------------
diff --git a/Lib/imp.py b/Lib/imp.py
index f6fff44..b339952 100644
--- a/Lib/imp.py
+++ b/Lib/imp.py
@@ -30,7 +30,7 @@ import warnings
warnings.warn("the imp module is deprecated in favour of importlib; "
"see the module's documentation for alternative uses",
- PendingDeprecationWarning, stacklevel=2)
+ DeprecationWarning, stacklevel=2)
# DEPRECATED
SEARCH_ERROR = 0
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py
index fc4a074..203d515 100644
--- a/Lib/pkgutil.py
+++ b/Lib/pkgutil.py
@@ -180,7 +180,7 @@ iter_importer_modules.register(
def _import_imp():
global imp
with warnings.catch_warnings():
- warnings.simplefilter('ignore', PendingDeprecationWarning)
+ warnings.simplefilter('ignore', DeprecationWarning)
imp = importlib.import_module('imp')
class ImpImporter:
diff --git a/Misc/NEWS b/Misc/NEWS
index bcc85a7..6e3e2c3 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -63,6 +63,8 @@ Core and Builtins
Library
-------
+- Move the imp module from a PendingDeprecationWarning to DeprecationWarning.
+
- Issue #25407: Remove mentions of the formatter module being removed in
Python 3.6.