[tasks] Fix change_interval raising when called during execution

This commit is contained in:
Lilly Rose Berner 2022-03-07 23:35:42 +01:00 committed by GitHub
parent caa816a636
commit b308b54b89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -692,7 +692,7 @@ class Loop(Generic[LF]):
self._prepare_time_index(now=self._last_iteration)
self._next_iteration = self._get_next_sleep_time()
if not self._handle.done():
if self._handle is not MISSING and not self._handle.done():
# the loop is sleeping, recalculate based on new interval
self._handle.recalculate(self._next_iteration)