]> git.michaelhowe.org Git - packages/b/bup.git/commitdiff
cmd-save: fix a potential divide by zero error.
authorAvery Pennarun <apenwarr@gmail.com>
Sat, 6 Feb 2010 22:01:03 +0000 (17:01 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Sat, 6 Feb 2010 22:03:10 +0000 (17:03 -0500)
In the progress calculation stuff.

cmd-save.py

index a179f7901c3e1852bbbf37c45d3ad4f86478786c..8a06593b70ffc8b94fee6e46be11c0e687ac33c4 100755 (executable)
@@ -65,7 +65,7 @@ lastremain = None
 def progress_report(n):
     global count, lastremain
     count += n
-    pct = count*100.0/total
+    pct = total and (count*100.0/total) or 0
     now = time.time()
     elapsed = now - tstart
     kps = elapsed and int(count/1024./elapsed)