aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/package_index.py
diff options
context:
space:
mode:
authorJens Timmerman <jens.timmerman@ugent.be>2016-06-08 16:56:06 +0200
committerJens Timmerman <jens.timmerman@ugent.be>2016-07-25 16:14:52 +0200
commit3fcd44be1e8d3d8b9f229333e8f43d4893658183 (patch)
treef71be483580e1c3fae8762882c70339df7b11b23 /setuptools/package_index.py
parent21ab99e53f0c263a2210cf51525d6edcae1ae9a7 (diff)
downloadexternal_python_setuptools-3fcd44be1e8d3d8b9f229333e8f43d4893658183.tar.gz
external_python_setuptools-3fcd44be1e8d3d8b9f229333e8f43d4893658183.tar.bz2
external_python_setuptools-3fcd44be1e8d3d8b9f229333e8f43d4893658183.zip
check if a download is successfull before deciding not to try the next possible dist
Diffstat (limited to 'setuptools/package_index.py')
-rwxr-xr-xsetuptools/package_index.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 0ea09bd6..8f8bf6ed 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -602,24 +602,26 @@ class PackageIndex(Environment):
continue
if dist in req and (dist.precedence <= SOURCE_DIST or not source):
- return dist
+ mylocation = self.download(dist.location, tmpdir)
+ if os.path.exists(mylocation):
+ return dist, mylocation
if force_scan:
self.prescan()
self.find_packages(requirement)
- dist = find(requirement)
+ dist, mylocation = find(requirement)
if local_index is not None:
- dist = dist or find(requirement, local_index)
+ dist, mylocation = dist, mylocation if dist else find(requirement, local_index)
if dist is None:
if self.to_scan is not None:
self.prescan()
- dist = find(requirement)
+ dist, mylocation = find(requirement)
if dist is None and not force_scan:
self.find_packages(requirement)
- dist = find(requirement)
+ dist, mylocation = find(requirement)
if dist is None:
self.warn(
@@ -629,7 +631,7 @@ class PackageIndex(Environment):
)
else:
self.info("Best match: %s", dist)
- return dist.clone(location=self.download(dist.location, tmpdir))
+ return dist.clone(location=mylocation)
def fetch(self, requirement, tmpdir, force_scan=False, source=False):
"""Obtain a file suitable for fulfilling `requirement`