From 3006569ef5d6ea5b2d6131c1934b858d2c33e3dc Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 28 Jul 2018 13:31:25 +0200 Subject: plugins: Switch exec and upload to async/await. --- plugins/upload.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'plugins/upload.py') diff --git a/plugins/upload.py b/plugins/upload.py index 0f9ef736..3b2b4075 100644 --- a/plugins/upload.py +++ b/plugins/upload.py @@ -38,10 +38,9 @@ class Plugin(BasePlugin): short='Upload a file', completion=self.completion_filename) - @asyncio.coroutine - def async_upload(self, filename): + async def async_upload(self, filename): try: - url = yield from self.core.xmpp['xep_0363'].upload_file(filename) + url = await self.core.xmpp['xep_0363'].upload_file(filename) except Exception: exception = traceback.format_exc() self.api.information('Failed to upload file: %s' % exception, 'Error') -- cgit v1.2.3