summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-12-13 21:31:30 +0100
committermathieui <mathieui@mathieui.net>2021-12-13 21:31:46 +0100
commit799a6a07a98d708d0645fad0343177526128974c (patch)
tree9c52d1becd4913e2f28ef9d4f267eacdd9186084
parentbe6dde17f16e85b50361a3db243e9b2e40b2cb5d (diff)
downloadslixmpp-799a6a07a98d708d0645fad0343177526128974c.tar.gz
slixmpp-799a6a07a98d708d0645fad0343177526128974c.tar.bz2
slixmpp-799a6a07a98d708d0645fad0343177526128974c.tar.xz
slixmpp-799a6a07a98d708d0645fad0343177526128974c.zip
fix: remove loop parameter when deprecated (3.10)
-rw-r--r--slixmpp/plugins/xep_0030/disco.py1
-rw-r--r--slixmpp/plugins/xep_0047/stream.py2
-rw-r--r--slixmpp/xmlstream/handler/waiter.py2
-rw-r--r--slixmpp/xmlstream/xmlstream.py8
4 files changed, 6 insertions, 7 deletions
diff --git a/slixmpp/plugins/xep_0030/disco.py b/slixmpp/plugins/xep_0030/disco.py
index 0fa09927..37d453aa 100644
--- a/slixmpp/plugins/xep_0030/disco.py
+++ b/slixmpp/plugins/xep_0030/disco.py
@@ -326,7 +326,6 @@ class XEP_0030(BasePlugin):
info_futures, _ = await asyncio.wait(
infos,
timeout=timeout,
- loop=self.xmpp.loop
)
self.domain_infos[domain] = [
diff --git a/slixmpp/plugins/xep_0047/stream.py b/slixmpp/plugins/xep_0047/stream.py
index f020ea68..0cda5dd9 100644
--- a/slixmpp/plugins/xep_0047/stream.py
+++ b/slixmpp/plugins/xep_0047/stream.py
@@ -115,7 +115,7 @@ class IBBytestream(object):
self.xmpp.add_event_handler('ibb_stream_end', on_close)
self.xmpp.add_event_handler('ibb_stream_data', on_data)
try:
- await asyncio.wait_for(end_future, timeout, loop=self.xmpp.loop)
+ await asyncio.wait_for(end_future, timeout)
except asyncio.TimeoutError:
raise IqTimeout(result)
finally:
diff --git a/slixmpp/xmlstream/handler/waiter.py b/slixmpp/xmlstream/handler/waiter.py
index dde49754..599004b5 100644
--- a/slixmpp/xmlstream/handler/waiter.py
+++ b/slixmpp/xmlstream/handler/waiter.py
@@ -80,7 +80,7 @@ class Waiter(BaseHandler):
try:
await wait_for(
- self._event.wait(), timeout, loop=stream.loop
+ self._event.wait(), timeout,
)
except TimeoutError:
log.warning("Timed out waiting for %s", self.name)
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index 30f99071..256eb2dc 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -449,7 +449,7 @@ class XMLStream(asyncio.BaseProtocol):
if self._connect_loop_wait > 0:
self.event('reconnect_delay', self._connect_loop_wait)
- await asyncio.sleep(self._connect_loop_wait, loop=self.loop)
+ await asyncio.sleep(self._connect_loop_wait)
record = await self._pick_dns_answer(self.default_domain)
if record is not None:
@@ -504,10 +504,10 @@ class XMLStream(asyncio.BaseProtocol):
else:
self.loop.run_until_complete(self.disconnected)
else:
- tasks: List[Future] = [asyncio.sleep(timeout, loop=self.loop)]
+ tasks: List[Future] = [asyncio.sleep(timeout)]
if not forever:
tasks.append(self.disconnected)
- self.loop.run_until_complete(asyncio.wait(tasks, loop=self.loop))
+ self.loop.run_until_complete(asyncio.wait(tasks))
def init_parser(self) -> None:
"""init the XML parser. The parser must always be reset for each new
@@ -715,7 +715,7 @@ class XMLStream(asyncio.BaseProtocol):
log.debug("reconnecting...")
async def handler(event: Any) -> None:
# We yield here to allow synchronous handlers to work first
- await asyncio.sleep(0, loop=self.loop)
+ await asyncio.sleep(0)
self.connect()
self.add_event_handler('disconnected', handler, disposable=True)
self.disconnect(wait, reason)