mirror of
https://github.com/verigak/progress.git
synced 2025-12-08 19:33:24 +00:00
Merge pull request #79 from mathstuf/avoid-division-by-zero
progress: avoid division by zero
This commit is contained in:
@@ -161,6 +161,8 @@ class Progress(Infinite):
|
||||
|
||||
@property
|
||||
def progress(self):
|
||||
if self.max == 0:
|
||||
return 0
|
||||
return min(1, self.index / self.max)
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user