From cb90bbc8671aa25e23e55341745cc2682547e5f0 Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Thu, 7 Dec 2017 11:17:03 +0100 Subject: [PATCH 2/4] virtinst: python3: avoid comparison of None and int This avoids the following error in python3: File "/usr/share/virt-manager/virtinst/progress.py", line 249, in _do_update ave_dl = format_number(self.re.average_rate()) File "/usr/share/virt-manager/virtinst/progress.py", line 481, in format_number while number > thresh and depth < max_depth: TypeError: '>' not supported between instances of 'NoneType' and 'int' --- virtinst/progress.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: virt-manager-2.1.0/virtinst/progress.py =================================================================== --- virt-manager-2.1.0.orig/virtinst/progress.py +++ virt-manager-2.1.0/virtinst/progress.py @@ -350,7 +350,7 @@ class RateEstimator: self.start_time = now self.last_update_time = now self.last_amount_read = 0 - self.ave_rate = None + self.ave_rate = 0 def update(self, amount_read, now=None): if now is None: @@ -363,7 +363,7 @@ class RateEstimator: # if we just started this file, all bets are off self.last_update_time = now self.last_amount_read = amount_read - self.ave_rate = None + self.ave_rate = 0 return time_diff = now - self.last_update_time