[tasks] remove redundant condition in Loop.next_iteration

self._task is only None if the Loop has never been started before, 
which means None should be returned always, regardless of how
many seconds was passed into the constructor

this didn't break anything before because self._next_iteration will
be None as well if self._task is None.
This commit is contained in:
Sebastian Law 2021-02-28 20:54:44 -08:00 committed by GitHub
parent 6c40e3b837
commit f7a4bef4ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,7 +154,7 @@ class Loop:
.. versionadded:: 1.3
"""
if self._task is None and self._sleep:
if self._task is None:
return None
elif self._task and self._task.done() or self._stop_next_iteration:
return None