diff --git a/docs/changes.rst b/docs/changes.rst index 177318630..6c354e9af 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -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) ------------------- diff --git a/src/virtualenv.py b/src/virtualenv.py index b41527e5f..23c3aff66 100755 --- a/src/virtualenv.py +++ b/src/virtualenv.py @@ -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: