From 9baa46e84fc910e4cf7d070de6a00b4c3342506e Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Wed, 23 Oct 2019 00:46:27 +0100 Subject: [PATCH] fix example/tqdm_wget unknown total - fixes #826 --- examples/tqdm_wget.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/tqdm_wget.py b/examples/tqdm_wget.py index e49039b3..7e9f6c53 100644 --- a/examples/tqdm_wget.py +++ b/examples/tqdm_wget.py @@ -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