aboutsummaryrefslogtreecommitdiffstats
path: root/ez_setup.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-02-16 09:49:33 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-02-16 09:49:33 -0500
commit4df44da1561f239f63ee24a44acfba06d3898de4 (patch)
tree9c3607ab7b0756d45c5553fcd5254309f6015878 /ez_setup.py
parentcf6639df27879641b6ea561fa38ec52320b09780 (diff)
downloadexternal_python_setuptools-4df44da1561f239f63ee24a44acfba06d3898de4.tar.gz
external_python_setuptools-4df44da1561f239f63ee24a44acfba06d3898de4.tar.bz2
external_python_setuptools-4df44da1561f239f63ee24a44acfba06d3898de4.zip
Extract function for unloading pkg_resources. Ref #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 154cae0a..4bffc14c 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -175,10 +175,15 @@ def use_setuptools(
# otherwise, unload pkg_resources to allow the downloaded version to
# take precedence.
- del pkg_resources, sys.modules['pkg_resources']
+ del pkg_resources
+ _unload_pkg_resources()
return _do_download(version, download_base, to_dir, download_delay)
+def _unload_pkg_resources():
+ del sys.modules['pkg_resources']
+
+
def _clean_check(cmd, target):
"""
Run the command to download target.