From 1a077215fa3e3279f7e732a8e63525d61bef0892 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Mon, 15 Nov 2021 21:16:09 +0100 Subject: [PATCH] Hotfix for 'RuntimeError: no running event loop' See https://gitlab.com/ekzyis/musicube/issues/22 --- src/log.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/log.py b/src/log.py index 21cb5f3..1a94c77 100644 --- a/src/log.py +++ b/src/log.py @@ -62,5 +62,9 @@ class DiscordLogger(logging.Handler): if self._channel is not None: await self._channel.send(msg) - - asyncio.create_task(_emit_to_channel()) + try: + asyncio.create_task(_emit_to_channel()) + except RuntimeError: + # This is a hotfix for "RuntimeError: no running event loop" (see #22) + # TODO investigate #22 and replace hotfix with proper fix + pass