aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve C <[email protected]>2019-04-12 16:39:26 -0400
committerRapptz <[email protected]>2019-04-12 20:56:40 -0400
commitac2cda1ffc37c6427a89781e2a4bf3f54410e54d (patch)
treeae38b2e7126ed1256094b2b747fd93bdc8b9fe66
parentRemove "needs python 3.5+" from async iter section (diff)
downloaddiscord.py-ac2cda1ffc37c6427a89781e2a4bf3f54410e54d.tar.xz
discord.py-ac2cda1ffc37c6427a89781e2a4bf3f54410e54d.zip
[tasks] set internal task to None after canceling
-rw-r--r--discord/ext/tasks/__init__.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/discord/ext/tasks/__init__.py b/discord/ext/tasks/__init__.py
index dab4b5ea..54b872ba 100644
--- a/discord/ext/tasks/__init__.py
+++ b/discord/ext/tasks/__init__.py
@@ -132,6 +132,7 @@ class Loop:
"""Cancels the internal task, if any are running."""
if self._task:
self._task.cancel()
+ self._task = None
def add_exception_type(self, exc):
r"""Adds an exception type to be handled during the reconnect logic.