Skip to content

Commit

Permalink
list()-ify filter() return, otherwise boolean checks against it are…
Browse files Browse the repository at this point in the history
… wrong
  • Loading branch information
jesopo committed Jun 1, 2019
1 parent c3454f2 commit 5077bad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Timers.py
Expand Up @@ -83,7 +83,8 @@ def _add(self, context: typing.Optional[str], name: str, delay: float,
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)
Expand Down

0 comments on commit 5077bad

Please sign in to comment.