Skip to content

Commit 186d00a

Browse files
committed
Fixed dive by 0 bug
1 parent fdcab2a commit 186d00a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nipype/interfaces/io.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ def __call__(self, bytes_amount):
162162
# With the lock on, print upload status
163163
with self._lock:
164164
self._seen_so_far += bytes_amount
165-
percentage = (self._seen_so_far / self._size) * 100
165+
if self._size != 0:
166+
percentage = (self._seen_so_far / self._size) * 100
167+
else:
168+
percentage = 0
166169
progress_str = '%d / %d (%.2f%%)\r'\
167170
% (self._seen_so_far, self._size, percentage)
168171

0 commit comments

Comments
 (0)