From 02f89258b8b2cb2d6724e42ada5479382922cca1 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 21 Nov 2022 09:49:57 +0100 Subject: [PATCH] FIX: Task.set_name only works on Python >= 3.8 --- platypush/plugins/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/__init__.py b/platypush/plugins/__init__.py index f35f06a4e6..fa7a06fc6c 100644 --- a/platypush/plugins/__init__.py +++ b/platypush/plugins/__init__.py @@ -158,7 +158,8 @@ class AsyncRunnablePlugin(RunnablePlugin, ABC): asyncio.set_event_loop(self._loop) self._task = self._loop.create_task(self._listen()) - self._task.set_name(self.__class__.__name__ + '.listen') + if hasattr(self._task, 'set_name'): + self._task.set_name(self.__class__.__name__ + '.listen') self._loop.run_forever() def main(self):