aboutsummaryrefslogtreecommitdiffstats
path: root/ez_setup.py
diff options
context:
space:
mode:
authorDweep Shah <dweepcan1@msn.com>2015-10-26 16:45:04 -0400
committerDweep Shah <dweepcan1@msn.com>2015-10-26 16:45:04 -0400
commit03cc3be9da0f1d31a3e4f2272d3ebb28ed761b35 (patch)
tree2fe7951ce0acbdb65ee57ee4eab94a742550072f /ez_setup.py
parentae6c73f07680da77345f5ccfac4facde30ad4d7e (diff)
downloadexternal_python_setuptools-03cc3be9da0f1d31a3e4f2272d3ebb28ed761b35.tar.gz
external_python_setuptools-03cc3be9da0f1d31a3e4f2272d3ebb28ed761b35.tar.bz2
external_python_setuptools-03cc3be9da0f1d31a3e4f2272d3ebb28ed761b35.zip
Unload all pkg_resources modules and not just the main module. Fixes #453.
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 50e0dfc6..bbfe0544 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -125,7 +125,12 @@ def _do_download(version, download_base, to_dir, download_delay):
# Remove previously-imported pkg_resources if present (see
# https://bitbucket.org/pypa/setuptools/pull-request/7/ for details).
if 'pkg_resources' in sys.modules:
- 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]
import setuptools
setuptools.bootstrap_install_from = egg