fix example/tqdm_wget unknown total

- fixes #826
This commit is contained in:
Casper da Costa-Luis 2019-10-23 00:46:27 +01:00
parent 6e50fa2719
commit 9baa46e84f
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
1 changed files with 3 additions and 2 deletions

View File

@ -48,9 +48,10 @@ def my_hook(t):
bsize : int, optional
Size of each block (in tqdm units) [default: 1].
tsize : int, optional
Total size (in tqdm units). If [default: None] remains unchanged.
Total size (in tqdm units). If [default: None] or -1,
remains unchanged.
"""
if tsize is not None:
if tsize not in (None, -1):
t.total = tsize
t.update((b - last_b[0]) * bsize)
last_b[0] = b