From f7a4bef4ff13689bc4168130edd582e7bcedac27 Mon Sep 17 00:00:00 2001 From: Sebastian Law <44045823+SebbyLaw@users.noreply.github.com> Date: Sun, 28 Feb 2021 20:54:44 -0800 Subject: [PATCH] [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. --- discord/ext/tasks/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/ext/tasks/__init__.py b/discord/ext/tasks/__init__.py index 9f6870057..818f38ad6 100644 --- a/discord/ext/tasks/__init__.py +++ b/discord/ext/tasks/__init__.py @@ -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