Commit 3fcd44be authored by Jens Timmerman's avatar Jens Timmerman

check if a download is successfull before deciding not to try the next possible dist

parent 21ab99e5
...@@ -602,24 +602,26 @@ class PackageIndex(Environment): ...@@ -602,24 +602,26 @@ class PackageIndex(Environment):
continue continue
if dist in req and (dist.precedence <= SOURCE_DIST or not source): 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: if force_scan:
self.prescan() self.prescan()
self.find_packages(requirement) self.find_packages(requirement)
dist = find(requirement) dist, mylocation = find(requirement)
if local_index is not None: 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 dist is None:
if self.to_scan is not None: if self.to_scan is not None:
self.prescan() self.prescan()
dist = find(requirement) dist, mylocation = find(requirement)
if dist is None and not force_scan: if dist is None and not force_scan:
self.find_packages(requirement) self.find_packages(requirement)
dist = find(requirement) dist, mylocation = find(requirement)
if dist is None: if dist is None:
self.warn( self.warn(
...@@ -629,7 +631,7 @@ class PackageIndex(Environment): ...@@ -629,7 +631,7 @@ class PackageIndex(Environment):
) )
else: else:
self.info("Best match: %s", dist) 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): def fetch(self, requirement, tmpdir, force_scan=False, source=False):
"""Obtain a file suitable for fulfilling `requirement` """Obtain a file suitable for fulfilling `requirement`
......
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