diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-02-16 10:02:04 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-02-16 10:02:04 -0500 |
commit | 947b300262d3415f4a1a073887973f2772792ae0 (patch) | |
tree | 7815e3a12512b706e0620302a868c64a2c6cc87d | |
parent | cd6f8d58314ce146b18142f4be56fc2a18f977d5 (diff) | |
download | external_python_setuptools-947b300262d3415f4a1a073887973f2772792ae0.tar.gz external_python_setuptools-947b300262d3415f4a1a073887973f2772792ae0.tar.bz2 external_python_setuptools-947b300262d3415f4a1a073887973f2772792ae0.zip |
Refactor behavior into a single try/except block with exactly one invocation of _do_download.
-rw-r--r-- | ez_setup.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ez_setup.py b/ez_setup.py index a1c69d0b..d8d2ad8b 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -156,12 +156,12 @@ def use_setuptools( """) try: import pkg_resources - except ImportError: - return _do_download(version, download_base, to_dir, download_delay) - try: pkg_resources.require("setuptools>=" + version) # a suitable version is already installed return + except ImportError: + # pkg_resources not available; setuptools is not installed; download + pass except pkg_resources.DistributionNotFound: # no version of setuptools was found; allow download pass |