Commit 833054f8 authored by Jason R. Coombs's avatar Jason R. Coombs

Reorder exception handlers to work around warning about 'pkg_resources' being undefined.

parent c070a1bb
......@@ -133,6 +133,8 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
try:
pkg_resources.require("setuptools>=" + version)
return
except pkg_resources.DistributionNotFound:
return _do_download(version, download_base, to_dir, download_delay)
except pkg_resources.VersionConflict:
if was_imported:
msg = textwrap.dedent("""
......@@ -149,8 +151,6 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
# otherwise, reload ok
del pkg_resources, sys.modules['pkg_resources']
return _do_download(version, download_base, to_dir, download_delay)
except pkg_resources.DistributionNotFound:
return _do_download(version, download_base, to_dir, download_delay)
def _clean_check(cmd, target):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment