Store output directory in build set instead of calculating in loop.

This commit is contained in:
Chris Hunt 2019-09-04 22:29:16 -04:00
parent 41f0ea076e
commit aa90d44239
1 changed files with 10 additions and 10 deletions

View File

@ -1071,7 +1071,15 @@ class WheelBuilder(object):
if ephem_cache is None:
continue
buildset.append((req, ephem_cache))
if should_unpack:
if ephem_cache:
output_dir = self.wheel_cache.get_ephem_path_for_link(req.link)
else:
output_dir = self.wheel_cache.get_path_for_link(req.link)
else:
output_dir = self._wheel_dir
buildset.append((req, output_dir))
if not buildset:
return []
@ -1091,15 +1099,7 @@ class WheelBuilder(object):
with indent_log():
build_success, build_failure = [], []
for req, ephem in buildset:
if should_unpack:
if ephem:
output_dir = self.wheel_cache.get_ephem_path_for_link(req.link)
else:
output_dir = self.wheel_cache.get_path_for_link(req.link)
else:
output_dir = self._wheel_dir
for req, output_dir in buildset:
try:
ensure_dir(output_dir)
except OSError as e: