aboutsummaryrefslogtreecommitdiff
path: root/discord/ext/tasks
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-11-19 21:59:39 -0500
committerRapptz <[email protected]>2019-11-19 21:59:39 -0500
commite1a237a0d382a714daae760c0e518e60a03a2d11 (patch)
treeebdfb48e572fca7495bcaab92a7e283ecd50b914 /discord/ext/tasks
parentRevert "[tasks] Add support for explicit time parameter when running." (diff)
downloaddiscord.py-e1a237a0d382a714daae760c0e518e60a03a2d11.tar.xz
discord.py-e1a237a0d382a714daae760c0e518e60a03a2d11.zip
Revert "[tasks] Add Loop.exception for more reliable exception retrieval."
This reverts commit 7a8c9e66d9c43a539fb78107ce3f51f16c7f30a2.
Diffstat (limited to 'discord/ext/tasks')
-rw-r--r--discord/ext/tasks/__init__.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/discord/ext/tasks/__init__.py b/discord/ext/tasks/__init__.py
index d22e7711..d45631ee 100644
--- a/discord/ext/tasks/__init__.py
+++ b/discord/ext/tasks/__init__.py
@@ -40,7 +40,6 @@ class Loop:
self._is_being_cancelled = False
self._has_failed = False
self._stop_next_iteration = False
- self._exception = None
if self.count is not None and self.count <= 0:
raise ValueError('count must be greater than 0 or None.')
@@ -82,9 +81,8 @@ class Loop:
except asyncio.CancelledError:
self._is_being_cancelled = True
raise
- except Exception as e:
+ except Exception:
self._has_failed = True
- self._exception = e
log.exception('Internal background task failed.')
raise
finally:
@@ -93,7 +91,6 @@ class Loop:
self._current_loop = 0
self._stop_next_iteration = False
self._has_failed = False
- self._exception = None
def __get__(self, obj, objtype):
if obj is None:
@@ -259,16 +256,6 @@ class Loop:
"""
return self._has_failed
- def exception(self):
- """Optional[:class:`Exception`]: The exception that the internal task failed with.
-
- .. versionadded:: 1.3.0
- """
- if self._exception is not None:
- return self._exception
- if self._task is not None:
- return self._task.exception()
-
def before_loop(self, coro):
"""A decorator that registers a coroutine to be called before the loop starts running.