forked from platypush/platypush
FIX: Task.set_name only works on Python >= 3.8
This commit is contained in:
parent
b8215d2736
commit
02f89258b8
1 changed files with 2 additions and 1 deletions
|
@ -158,7 +158,8 @@ class AsyncRunnablePlugin(RunnablePlugin, ABC):
|
||||||
asyncio.set_event_loop(self._loop)
|
asyncio.set_event_loop(self._loop)
|
||||||
|
|
||||||
self._task = self._loop.create_task(self._listen())
|
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()
|
self._loop.run_forever()
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
|
|
Loading…
Reference in a new issue