From 79bbbdb3e633152cc95e77a550f2eb2cde4e6784 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 18 Nov 2021 15:23:46 +0100 Subject: Replace asyncio.ensure_future() with asyncio.create_task() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The latter function got introduced in Python 3.7, which is conveniently our MSPV, so let’s use that. --- plugins/ping.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/ping.py') diff --git a/plugins/ping.py b/plugins/ping.py index 46ce4efc..cc987bf0 100644 --- a/plugins/ping.py +++ b/plugins/ping.py @@ -123,7 +123,7 @@ class Plugin(BasePlugin): jid = arg if not arg: jid = self.api.current_tab().jid - asyncio.ensure_future( + asyncio.create_task( self.command_ping(jid) ) @@ -140,7 +140,7 @@ class Plugin(BasePlugin): jid = JID(arg) except InvalidJID: return self.api.information('Invalid JID: %s' % arg, 'Error') - asyncio.ensure_future( + asyncio.create_task( self.command_ping(jid.full) ) @@ -156,7 +156,7 @@ class Plugin(BasePlugin): res = current.get_highest_priority_resource() if res is not None: jid =res.jid - asyncio.ensure_future( + asyncio.create_task( self.command_ping(jid) ) -- cgit v1.2.3