[diffoscope] 02/02: diffoscope.progress: Support the new fork of python-progressbar. (Closes: #873157)

Chris Lamb chris at chris-lamb.co.uk
Fri Aug 25 08:37:19 CEST 2017


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

lamby pushed a commit to branch master
in repository diffoscope.

commit 8e1761586fef81ececa156c98f677d044f09a9aa
Author: Santiago Torres-Arias <torresariass at gmail.com>
Date:   Fri Aug 25 07:35:54 2017 +0100

    diffoscope.progress: Support the new fork of python-progressbar. (Closes: #873157)
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 diffoscope/progress.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/diffoscope/progress.py b/diffoscope/progress.py
index 76f0cd1..1d5957e 100644
--- a/diffoscope/progress.py
+++ b/diffoscope/progress.py
@@ -191,9 +191,15 @@ class ProgressBar(object):
     def __init__(self):
         import progressbar
 
+        try:
+            from progressbar.widgets import WidgetBase
+        except ImportError:
+            # Fallback to the older Debian version
+            from progressbar import Widget as WidgetBase
+
         self.msg = ""
 
-        class Message(progressbar.Widget):
+        class Message(WidgetBase):
             def update(self, pbar, _observer=self):
                 msg = _observer.msg
                 width = 25

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


More information about the diffoscope mailing list