From 3c997a6b21ccf6d7b040ac6b94e3a6fb6c22be4a Mon Sep 17 00:00:00 2001 From: Alan Justino da Silva Date: Tue, 25 Nov 2014 11:54:06 -0200 Subject: [PATCH] Shall not divide by zero. --- progressbar/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progressbar/__init__.py b/progressbar/__init__.py index 7fffe69..100e41a 100644 --- a/progressbar/__init__.py +++ b/progressbar/__init__.py @@ -205,7 +205,7 @@ def _handle_resize(self, signum=None, frame=None): def percentage(self): 'Returns the progress as a percentage.' - return self.currval * 100.0 / self.maxval + return self.currval * 100.0 / (self.maxval or 1) percent = property(percentage)