summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-07-08 20:52:27 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-07-08 20:52:27 +0200
commitf49403ae2c8b04f8ff76e074c780c6867f64f935 (patch)
tree5e7dca5f936e5d36c3312c506db61b8c07179495
parent45ee57fd19d574739d9f92272ba2987f7ebf86e5 (diff)
Fix exception when uploading 0-byte filev2.0.2working
This could be triggered by an empty file (really empty). The assert is supposed to catch progress calls without a proper upload total being set. We can easily use -1 rather than 0 for that. Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xfb.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/fb.py b/fb.py
index 44b4461..4f6868a 100755
--- a/fb.py
+++ b/fb.py
@@ -277,12 +277,12 @@ class ProgressBar:
self.progressData["ulGlobalTotal"] = value
def reset(self):
- self.progressData["ulGlobalTotal"] = 0
+ self.progressData["ulGlobalTotal"] = -1
self.progressData["ulGlobal"] = 0
def progress(self, dltotal, dlnow, ultotal, ulnow):
data = self.progressData
- assert data["ulGlobalTotal"] > 0
+ assert data["ulGlobalTotal"] > -1
if not self.display_progress:
return