summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-02-20 12:42:34 +0100
committermathieui <mathieui@mathieui.net>2021-02-20 12:42:34 +0100
commit35c68738a74da63a3daba4d57f22971af518387f (patch)
tree09f018886cb63560815310fa0080677623c4697f
parent35a9526a4ce177d00be1fc6d168626c1d6edef31 (diff)
parent751987e2b0c9b2eb3757fcf2a889482a1cb04b3a (diff)
downloadslixmpp-35c68738a74da63a3daba4d57f22971af518387f.tar.gz
slixmpp-35c68738a74da63a3daba4d57f22971af518387f.tar.bz2
slixmpp-35c68738a74da63a3daba4d57f22971af518387f.tar.xz
slixmpp-35c68738a74da63a3daba4d57f22971af518387f.zip
Merge branch 'remove-loop-wait-for' into 'master'
xmlstream: remove loop parameter to wait_for See merge request poezio/slixmpp!137
-rw-r--r--slixmpp/xmlstream/xmlstream.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index de3ea8cf..8a726e15 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -533,7 +533,6 @@ class XMLStream(asyncio.BaseProtocol):
await asyncio.wait_for(
self.waiting_queue.join(),
wait,
- loop=self.loop
)
except asyncio.TimeoutError:
wait = 0 # we already consumed the timeout
@@ -1182,20 +1181,25 @@ class XMLStream(asyncio.BaseProtocol):
:param str event: Event to wait on.
:param int timeout: Timeout
+ :raises: :class:`asyncio.TimeoutError` when the timeout is reached
"""
fut = asyncio.Future()
+
def result_handler(event_data):
if not fut.done():
fut.set_result(event_data)
else:
- log.debug("Future registered on event '%s' was alredy done", event)
+ log.debug(
+ "Future registered on event '%s' was alredy done",
+ event
+ )
self.add_event_handler(
event,
result_handler,
disposable=True,
)
- return await asyncio.wait_for(fut, timeout, loop=self.loop)
+ return await asyncio.wait_for(fut, timeout)
@contextmanager
def event_handler(self, event: str, handler: Callable):