Upgrade the imp module's deprecation to DeprecationWarning.
This commit is contained in:
parent
aa15ea4b4e
commit
c0d91aff9a
|
@ -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
|
||||
--------------------
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue