[diffoscope] 01/01: Avoid division-by-zero in the progress bar

Ximin Luo infinity0 at debian.org
Thu Dec 8 15:17:20 CET 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository diffoscope.

commit 02eccc43d2bc248f0c2f634f0b97fdab42ffeb2e
Author: Ximin Luo <infinity0 at debian.org>
Date:   Thu Dec 8 15:16:39 2016 +0100

    Avoid division-by-zero in the progress bar
    
    Causing reprotest test failures atm
---
 diffoscope/progress.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/diffoscope/progress.py b/diffoscope/progress.py
index f59ace3..a7d2ff6 100644
--- a/diffoscope/progress.py
+++ b/diffoscope/progress.py
@@ -104,6 +104,9 @@ class ProgressBar(object):
         self.bar.start()
 
     def notify(self, current, total):
+        if not total:
+            total = 1
+            current = 1
         self.bar.maxval = total
         self.bar.currval = current
         self.bar.update()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list