cannot compare number with None

TypeError: '<' not supported between instances of 'float' and 'NoneType'
This commit is contained in:
MirceaDan committed 2018-12-01 20:02:22 -08:00
1 parent f72f948744
commit 94ce6f1dd1
1 file changed
+3 -3
+3 -3
View File
@@ -220,20 +220,20 @@ class TimeEstimationHelper(object):
@property
def average_total(self):
if not self._count:
return None
return -1
else:
return self._sum_total / self._count
@property
def average_total_rolling(self):
if not self._count or self._count < self._rolling_window:
return None
return -1
else:
return sum(self._totals) / len(self._totals)
@property
def average_distance(self):
if not self._count or self._count < self._rolling_window + 1:
return None
return -1
else:
return sum(self._distances) / len(self._distances)