list()-ify filter() return, otherwise boolean checks against it are wrong

This commit is contained in:
jesopo 2019-06-01 15:05:57 +01:00
parent c3454f2bfe
commit 5077bad522

View file

@ -83,7 +83,8 @@ class Timers(object):
self.timers.append(timer)
def next(self) -> typing.Optional[float]:
times = filter(None, [timer.time_left() for timer in self.get_timers()])
times = list(filter(None,
[timer.time_left() for timer in self.get_timers()]))
if not times:
return None
return max(min(times), 0)