From 1a077215fa3e3279f7e732a8e63525d61bef0892 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Mon, 15 Nov 2021 21:16:09 +0100 Subject: [PATCH 1/2] 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 From dd82c748a249b5fca6033a9b7241a0e3a5d2bd10 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Mon, 15 Nov 2021 21:18:54 +0100 Subject: [PATCH 2/2] Disable fixme in .pylintrc --- .pylintrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 78b6d2c..ff49dca 100644 --- a/.pylintrc +++ b/.pylintrc @@ -13,7 +13,8 @@ disable= redefined-outer-name, invalid-name, no-self-use, - too-many-instance-attributes + too-many-instance-attributes, + fixme [FORMAT] indent-string=' '