From 6b5be39cd2468fcef3753cacbc014f2c55956e16 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 28 Jun 2020 17:53:29 +1000 Subject: [PATCH] [tasks] Fix issue with default error handler in class context --- discord/ext/tasks/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discord/ext/tasks/__init__.py b/discord/ext/tasks/__init__.py index 833fc65a9..8a2ea5111 100644 --- a/discord/ext/tasks/__init__.py +++ b/discord/ext/tasks/__init__.py @@ -293,7 +293,8 @@ class Loop: """ return not bool(self._task.done()) if self._task else False - async def _error(self, exception): + async def _error(self, *args): + exception = args[-1] print('Unhandled exception in internal background task {0.__name__!r}.'.format(self.coro), file=sys.stderr) traceback.print_exception(type(exception), exception, exception.__traceback__, file=sys.stderr)