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/vcard.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/vcard.py') diff --git a/plugins/vcard.py b/plugins/vcard.py index ef70dc79..b0c8e396 100644 --- a/plugins/vcard.py +++ b/plugins/vcard.py @@ -266,7 +266,7 @@ class Plugin(BasePlugin): self.api.information('Invalid JID: %s' % arg, 'Error') return - asyncio.ensure_future( + asyncio.create_task( self._get_vcard(jid) ) @@ -290,7 +290,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._get_vcard(jid) ) @@ -301,11 +301,11 @@ class Plugin(BasePlugin): return current = self.api.current_tab().selected_row if isinstance(current, Resource): - asyncio.ensure_future( + asyncio.create_task( self._get_vcard(JID(current.jid).bare) ) elif isinstance(current, Contact): - asyncio.ensure_future( + asyncio.create_task( self._get_vcard(current.bare_jid) ) -- cgit v1.2.3