From 3502480384bd7d9f4e4eb1a3b92e8df08f4e487c Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 1 Jul 2018 18:46:33 +0200 Subject: Switch from @asyncio.coroutine to async def everywhere. --- slixmpp/plugins/xep_0198/stream_management.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'slixmpp/plugins/xep_0198') diff --git a/slixmpp/plugins/xep_0198/stream_management.py b/slixmpp/plugins/xep_0198/stream_management.py index fbc9e023..759e82e1 100644 --- a/slixmpp/plugins/xep_0198/stream_management.py +++ b/slixmpp/plugins/xep_0198/stream_management.py @@ -174,8 +174,7 @@ class XEP_0198(BasePlugin): req = stanza.RequestAck(self.xmpp) self.xmpp.send_raw(str(req)) - @asyncio.coroutine - def _handle_sm_feature(self, features): + async def _handle_sm_feature(self, features): """ Enable or resume stream management. @@ -203,7 +202,7 @@ class XEP_0198(BasePlugin): MatchXPath(stanza.Enabled.tag_name()), MatchXPath(stanza.Failed.tag_name())])) self.xmpp.register_handler(waiter) - result = yield from waiter.wait() + result = await waiter.wait() elif self.sm_id and self.allow_resume and 'bind' not in self.xmpp.features: self.enabled = True resume = stanza.Resume(self.xmpp) @@ -219,7 +218,7 @@ class XEP_0198(BasePlugin): MatchXPath(stanza.Resumed.tag_name()), MatchXPath(stanza.Failed.tag_name())])) self.xmpp.register_handler(waiter) - result = yield from waiter.wait() + result = await waiter.wait() if result is not None and result.name == 'resumed': return True return False -- cgit v1.2.3