aboutsummaryrefslogtreecommitdiffstats
path: root/ez_setup.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-02-16 09:51:51 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-02-16 09:51:51 -0500
commite1bc6caa509afc1df671a21b94d33906a88930d9 (patch)
tree6164deae8c2b71c1e310a2dac3450cc93430f8bd /ez_setup.py
parent4df44da1561f239f63ee24a44acfba06d3898de4 (diff)
downloadexternal_python_setuptools-e1bc6caa509afc1df671a21b94d33906a88930d9.tar.gz
external_python_setuptools-e1bc6caa509afc1df671a21b94d33906a88930d9.tar.bz2
external_python_setuptools-e1bc6caa509afc1df671a21b94d33906a88930d9.zip
Unload all pkg_resources modules and not just the main module. Fixes #345.
Diffstat (limited to 'ez_setup.py')
-rw-r--r--ez_setup.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ez_setup.py b/ez_setup.py
index 4bffc14c..0734d6c5 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -181,7 +181,12 @@ def use_setuptools(
def _unload_pkg_resources():
- del sys.modules['pkg_resources']
+ del_modules = [
+ name for name in sys.modules
+ if name.startswith('pkg_resources')
+ ]
+ for mod_name in del_modules:
+ del sys.modules[mod_name]
def _clean_check(cmd, target):