Skip to content

Commit

Permalink
suppress imp module deprecation (#1238)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfmoore authored and gaborbernat committed Oct 31, 2018
1 parent a734706 commit 379f748
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Release History
* ``activate.csh`` does not use basename and handles newlines :issue:`1200`
* fix failure to copy on platforms that use lib64 :issue:`1189`
* enable tab-completion in the interactive interpreter by default, thanks to a new ``sys.__interactivehook__`` on Python 3 :issue:`967`

* suppress warning of usage of the deprecated ``imp`` module :issue:`1238`

16.0.0 (2018-05-16)
-------------------
Expand Down
8 changes: 7 additions & 1 deletion src/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,13 @@ def change_prefix(filename, dst_prefix):


def copy_required_modules(dst_prefix, symlink):
import imp
import warnings

with warnings.catch_warnings():
# Ignore deprecation of the imp module
# TODO: do not use deprecated imp module
warnings.simplefilter("ignore")
import imp

for modname in REQUIRED_MODULES:
if modname in sys.builtin_module_names:
Expand Down

0 comments on commit 379f748

Please sign in to comment.