Skip to content

Commit

Permalink
Upgrade the imp module's deprecation to DeprecationWarning.
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcannon committed Oct 16, 2015
1 parent aa15ea4 commit c0d91af
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Doc/whatsnew/3.6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------------
Expand Down
2 changes: 1 addition & 1 deletion Lib/imp.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

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
Expand Down
2 changes: 1 addition & 1 deletion Lib/pkgutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _iter_file_finder_modules(importer, prefix=''):
def _import_imp():
global imp
with warnings.catch_warnings():
warnings.simplefilter('ignore', PendingDeprecationWarning)
warnings.simplefilter('ignore', DeprecationWarning)
imp = importlib.import_module('imp')

class ImpImporter:
Expand Down
2 changes: 2 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit c0d91af

Please sign in to comment.