]> granicus.if.org Git - python/commitdiff
Upgrade the imp module's deprecation to DeprecationWarning.
authorBrett Cannon <brett@python.org>
Fri, 16 Oct 2015 19:21:37 +0000 (12:21 -0700)
committerBrett Cannon <brett@python.org>
Fri, 16 Oct 2015 19:21:37 +0000 (12:21 -0700)
Doc/whatsnew/3.6.rst
Lib/imp.py
Lib/pkgutil.py
Misc/NEWS

index edacea12e6a124de99662ff9110ac9b6e77a6ead..b3742807019fe080c91beaa43d867a489a4830ef 100644 (file)
@@ -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
 --------------------
index f6fff442013ae1d719f28bc1eaa91b337788c6cc..b33995267b8a827adf38df95778df57750456f91 100644 (file)
@@ -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
index fc4a074f5b8700ee98f788c71cc2513aa6366e63..203d515e5ebd36c792a591ffcc88dd0c777762d2 100644 (file)
@@ -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:
index bcc85a755c04cf80f81de2217f435b07aaba5e36..6e3e2c32c8f5625fb68b99317d3d2ae6c6115b82 100644 (file)
--- 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.