summaryrefslogtreecommitdiff
path: root/slixmpp/features
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-01 18:46:33 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-01 18:46:33 +0200
commit3502480384bd7d9f4e4eb1a3b92e8df08f4e487c (patch)
treea2e68835f4de6c32808412455f88310c05528191 /slixmpp/features
parent66909aafb300868ffd3ed9ab02bc3bd28c49a6e9 (diff)
downloadslixmpp-3502480384bd7d9f4e4eb1a3b92e8df08f4e487c.tar.gz
slixmpp-3502480384bd7d9f4e4eb1a3b92e8df08f4e487c.tar.bz2
slixmpp-3502480384bd7d9f4e4eb1a3b92e8df08f4e487c.tar.xz
slixmpp-3502480384bd7d9f4e4eb1a3b92e8df08f4e487c.zip
Switch from @asyncio.coroutine to async def everywhere.
Diffstat (limited to 'slixmpp/features')
-rw-r--r--slixmpp/features/feature_bind/bind.py5
-rw-r--r--slixmpp/features/feature_session/session.py5
2 files changed, 4 insertions, 6 deletions
diff --git a/slixmpp/features/feature_bind/bind.py b/slixmpp/features/feature_bind/bind.py
index e837ee0a..bd2a3b99 100644
--- a/slixmpp/features/feature_bind/bind.py
+++ b/slixmpp/features/feature_bind/bind.py
@@ -35,8 +35,7 @@ class FeatureBind(BasePlugin):
register_stanza_plugin(Iq, stanza.Bind)
register_stanza_plugin(StreamFeatures, stanza.Bind)
- @asyncio.coroutine
- def _handle_bind_resource(self, features):
+ async def _handle_bind_resource(self, features):
"""
Handle requesting a specific resource.
@@ -51,7 +50,7 @@ class FeatureBind(BasePlugin):
if self.xmpp.requested_jid.resource:
iq['bind']['resource'] = self.xmpp.requested_jid.resource
- yield from iq.send(callback=self._on_bind_response)
+ await iq.send(callback=self._on_bind_response)
def _on_bind_response(self, response):
self.xmpp.boundjid = JID(response['bind']['jid'])
diff --git a/slixmpp/features/feature_session/session.py b/slixmpp/features/feature_session/session.py
index e0e69e87..643c34ef 100644
--- a/slixmpp/features/feature_session/session.py
+++ b/slixmpp/features/feature_session/session.py
@@ -35,8 +35,7 @@ class FeatureSession(BasePlugin):
register_stanza_plugin(Iq, stanza.Session)
register_stanza_plugin(StreamFeatures, stanza.Session)
- @asyncio.coroutine
- def _handle_start_session(self, features):
+ async def _handle_start_session(self, features):
"""
Handle the start of the session.
@@ -51,7 +50,7 @@ class FeatureSession(BasePlugin):
iq = self.xmpp.Iq()
iq['type'] = 'set'
iq.enable('session')
- yield from iq.send(callback=self._on_start_session_response)
+ await iq.send(callback=self._on_start_session_response)
def _on_start_session_response(self, response):
self.xmpp.features.add('session')