From d4d542b7411c9f2d099d17bae0acfe327318442c Mon Sep 17 00:00:00 2001 From: Florian Klien Date: Sat, 27 Oct 2018 21:38:50 +0200 Subject: fixing uncaught async exceptions due to missing await fixes uncaught exceptions in the event loop. passing timeout and timeout_callback through. --- slixmpp/plugins/xep_0363/http_upload.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'slixmpp') diff --git a/slixmpp/plugins/xep_0363/http_upload.py b/slixmpp/plugins/xep_0363/http_upload.py index 65894975..50cdc5a9 100644 --- a/slixmpp/plugins/xep_0363/http_upload.py +++ b/slixmpp/plugins/xep_0363/http_upload.py @@ -6,7 +6,6 @@ See the file LICENSE for copying permission. """ -import asyncio import logging import os.path @@ -68,8 +67,9 @@ class XEP_0363(BasePlugin): def _handle_request(self, iq): self.xmpp.event('http_upload_request', iq) - async def find_upload_service(self, timeout=None): - results = await self.xmpp['xep_0030'].get_info_from_domain() + async def find_upload_service(self, timeout=None, timeout_callback=None): + results = await self.xmpp['xep_0030'].get_info_from_domain( + timeout=timeout, timeout_callback=timeout_callback) for info in results: for identity in info['disco_info']['identities']: @@ -94,7 +94,8 @@ class XEP_0363(BasePlugin): callback=None, timeout_callback=None): ''' Helper function which does all of the uploading process. ''' if self.upload_service is None: - info_iq = await self.find_upload_service(timeout=timeout) + info_iq = await self.find_upload_service( + timeout=timeout, timeout_callback=timeout_callback) if info_iq is None: raise UploadServiceNotFound() self.upload_service = info_iq['from'] -- cgit v1.2.3