Fix divide-by-zero in rescaleProgress
This commit is contained in:
parent
76090f6d36
commit
a7b0b64578
@ -29,7 +29,12 @@ def rescaleProgress(iterable, start, end):
|
|||||||
if len(progress) > 2:
|
if len(progress) > 2:
|
||||||
status = progress[2]
|
status = progress[2]
|
||||||
|
|
||||||
yield start + current * d / maximum, end, status
|
if maximum:
|
||||||
|
offset = current * d / maximum
|
||||||
|
else:
|
||||||
|
offset = 0
|
||||||
|
|
||||||
|
yield start + offset, end, status
|
||||||
else:
|
else:
|
||||||
yield progress
|
yield progress
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user