From: Avery Pennarun Date: Sat, 6 Feb 2010 22:01:03 +0000 (-0500) Subject: cmd-save: fix a potential divide by zero error. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=9fdf1da4872888c432f8af4bdf3d2468b18995fb;p=packages%2Fb%2Fbup.git cmd-save: fix a potential divide by zero error. In the progress calculation stuff. --- diff --git a/cmd-save.py b/cmd-save.py index a179f79..8a06593 100755 --- a/cmd-save.py +++ b/cmd-save.py @@ -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)