diff options
author | Alex Grönholm <alex.gronholm@nextday.fi> | 2016-03-17 01:10:15 +0000 |
---|---|---|
committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2016-03-17 01:10:15 +0000 |
commit | ae6ebd7837573c7f86b07b14725937b3f9d43d1e (patch) | |
tree | e11b4c6d356e6441e105efc13791a816c08b7ca7 | |
parent | e570a849413f3325c3583afa1fe4f083c9302f92 (diff) | |
download | python-setuptools-git-ae6ebd7837573c7f86b07b14725937b3f9d43d1e.tar.gz |
Remove the import hook when unloading the old pkg_resources modules
--HG--
branch : agronholm/remove-the-import-hook-when-unloading-th-1458177009332
-rw-r--r-- | ez_setup.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ez_setup.py b/ez_setup.py index 9715bdc7..4faa5218 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -192,6 +192,11 @@ def _conflict_bail(VC_err, version): def _unload_pkg_resources(): + from pkg_resources.extern import VendorImporter + sys.meta_path = [importer for importer in sys.meta_path if + not isinstance(importer, VendorImporter)] + del VendorImporter + del_modules = [ name for name in sys.modules if name.startswith('pkg_resources') |