It would be nice if this division by zero was avoided:
diff --git a/progressbar/progressbar.py b/progressbar/progressbar.py
--- a/progressbar/progressbar.py
+++ b/progressbar/progressbar.py
@@ -184,7 +184,7 @@
def percentage(self):
"""Returns the progress as a percentage."""
- if self.currval >= self.maxval:
+ if self.currval >= self.maxval or self.maxval == 0:
return 100.0
return self.currval * 100.0 / self.maxval
Original issue reported on code.google.com by wole...@gmail.com on 8 Aug 2014 at 6:57
Original issue reported on code.google.com by
wole...@gmail.com
on 8 Aug 2014 at 6:57