Merge pull request #79 from mathstuf/avoid-division-by-zero

progress: avoid division by zero
This commit is contained in:
Georgios Verigakis
2020-07-20 12:39:10 +03:00
committed by GitHub

View File

@@ -161,6 +161,8 @@ class Progress(Infinite):
@property @property
def progress(self): def progress(self):
if self.max == 0:
return 0
return min(1, self.index / self.max) return min(1, self.index / self.max)
@property @property