Prevent zero division error in download speed calculation

This commit is contained in:
Paul Moore 2014-09-29 19:52:16 +01:00
parent 4411d86f04
commit 5ed05b4dcb
1 changed files with 3 additions and 0 deletions

View File

@ -23,6 +23,9 @@ class DownloadProgressMixin(object):
@property
def download_speed(self):
# Avoid zero division errors...
if self.avg == 0.0:
return "..."
return format_size(1 / self.avg) + "/s"
@property