From 5ed05b4dcb6223a7c1b8e7be7d47a375d643ed12 Mon Sep 17 00:00:00 2001 From: Paul Moore Date: Mon, 29 Sep 2014 19:52:16 +0100 Subject: [PATCH] Prevent zero division error in download speed calculation --- pip/utils/ui.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pip/utils/ui.py b/pip/utils/ui.py index b190345b5..4cf99bf75 100644 --- a/pip/utils/ui.py +++ b/pip/utils/ui.py @@ -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