Fix unneccessary re-downloads when re-vendoring

This commit is contained in:
Kovid Goyal 2021-03-04 21:47:42 +05:30
parent d148e2da5f
commit 1967b3e95d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -32,10 +32,10 @@ class ReVendor(Command):
for i in range(num):
try:
raw = download_securely(url)
except Exception:
except Exception as err:
if i == num - 1:
raise
self.info('Download failed, sleeping and retrying...')
self.info(f'Download failed with error "{err}" sleeping and retrying...')
time.sleep(2)
with tarfile.open(fileobj=BytesIO(raw)) as tf:
tf.extractall(tdir)