summaryrefslogtreecommitdiff
path: root/plugins/upload.py
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-28 13:31:25 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-28 13:31:25 +0200
commit3006569ef5d6ea5b2d6131c1934b858d2c33e3dc (patch)
treea708fbe20a38374629b64f20377f3f2a4942b377 /plugins/upload.py
parent6be1a233e4f19fa5811a520fb17a9288c1d493b3 (diff)
downloadpoezio-3006569ef5d6ea5b2d6131c1934b858d2c33e3dc.tar.gz
poezio-3006569ef5d6ea5b2d6131c1934b858d2c33e3dc.tar.bz2
poezio-3006569ef5d6ea5b2d6131c1934b858d2c33e3dc.tar.xz
poezio-3006569ef5d6ea5b2d6131c1934b858d2c33e3dc.zip
plugins: Switch exec and upload to async/await.
Diffstat (limited to 'plugins/upload.py')
-rw-r--r--plugins/upload.py5
1 files changed, 2 insertions, 3 deletions
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')