mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-22 10:14:40 +02:00
Retry download on fail
This commit is contained in:
parent
a3bf706825
commit
98ec15b970
1 changed files with 5 additions and 1 deletions
|
|
@ -364,7 +364,11 @@ def pre_sub_commands(self, opts):
|
|||
import tarfile
|
||||
self.info('Downloading translations...')
|
||||
st = time.time()
|
||||
data = download_securely(tarball_url)
|
||||
try:
|
||||
data = download_securely(tarball_url)
|
||||
except Exception:
|
||||
time.sleep(1)
|
||||
data = download_securely(tarball_url)
|
||||
tarfile.open(fileobj=io.BytesIO(data)).extractall(tdir)
|
||||
x = os.listdir(tdir)[0]
|
||||
for y in os.listdir(os.path.join(tdir, x)):
|
||||
|
|
|
|||
Loading…
Reference in a new issue