mirror of https://github.com/pypa/pip
Prevent zero division error in download speed calculation
This commit is contained in:
parent
4411d86f04
commit
5ed05b4dcb
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue