diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2021-11-18 15:23:46 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-12-11 19:16:33 +0100 |
commit | 79bbbdb3e633152cc95e77a550f2eb2cde4e6784 (patch) | |
tree | 090c32aa64837d48b5851fb56a84fa7ee76399c6 /plugins/user_extras.py | |
parent | 2c59fa067af90bc116953f2ae162f5da4c1b6002 (diff) | |
download | poezio-79bbbdb3e633152cc95e77a550f2eb2cde4e6784.tar.gz poezio-79bbbdb3e633152cc95e77a550f2eb2cde4e6784.tar.bz2 poezio-79bbbdb3e633152cc95e77a550f2eb2cde4e6784.tar.xz poezio-79bbbdb3e633152cc95e77a550f2eb2cde4e6784.zip |
Replace asyncio.ensure_future() with asyncio.create_task()
The latter function got introduced in Python 3.7, which is conveniently
our MSPV, so let’s use that.
Diffstat (limited to 'plugins/user_extras.py')
-rw-r--r-- | plugins/user_extras.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/user_extras.py b/plugins/user_extras.py index ad49a142..96559111 100644 --- a/plugins/user_extras.py +++ b/plugins/user_extras.py @@ -91,10 +91,7 @@ Configuration """ -from asyncio import ( - ensure_future, - gather, -) +import asyncio from functools import reduce from typing import Dict @@ -174,10 +171,10 @@ class Plugin(BasePlugin): ] for name, handler in handlers: self.core.xmpp.del_event_handler(name, handler) - ensure_future(self._stop()) + asyncio.create_task(self._stop()) async def _stop(self): - await gather( + await asyncio.gather( self.core.xmpp.plugin['xep_0108'].stop(), self.core.xmpp.plugin['xep_0107'].stop(), self.core.xmpp.plugin['xep_0196'].stop(), |