mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-11 04:17:58 +00:00
[tasks] Fix Task.failed() only being True while error handler runs
This commit is contained in:
parent
5456c0cae9
commit
15a6a04622
@ -271,7 +271,6 @@ class Loop(Generic[LF]):
|
|||||||
self._is_being_cancelled = False
|
self._is_being_cancelled = False
|
||||||
self._current_loop = 0
|
self._current_loop = 0
|
||||||
self._stop_next_iteration = False
|
self._stop_next_iteration = False
|
||||||
self._has_failed = False
|
|
||||||
|
|
||||||
def __get__(self, obj: T, objtype: Type[T]) -> Loop[LF]:
|
def __get__(self, obj: T, objtype: Type[T]) -> Loop[LF]:
|
||||||
if obj is None:
|
if obj is None:
|
||||||
@ -397,6 +396,7 @@ class Loop(Generic[LF]):
|
|||||||
if self._injected is not None:
|
if self._injected is not None:
|
||||||
args = (self._injected, *args)
|
args = (self._injected, *args)
|
||||||
|
|
||||||
|
self._has_failed = False
|
||||||
self._task = asyncio.create_task(self._loop(*args, **kwargs))
|
self._task = asyncio.create_task(self._loop(*args, **kwargs))
|
||||||
return self._task
|
return self._task
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user