summaryrefslogtreecommitdiff
path: root/examples/roster_browser.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/roster_browser.py')
-rwxr-xr-xexamples/roster_browser.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/roster_browser.py b/examples/roster_browser.py
index eb92ad2a..6ad8b2a4 100755
--- a/examples/roster_browser.py
+++ b/examples/roster_browser.py
@@ -38,8 +38,7 @@ class RosterBrowser(slixmpp.ClientXMPP):
self.received = set()
self.presences_received = asyncio.Event()
- @asyncio.coroutine
- def start(self, event):
+ async def start(self, event):
"""
Process the session_start event.
@@ -57,7 +56,7 @@ class RosterBrowser(slixmpp.ClientXMPP):
future.set_result(None)
try:
self.get_roster(callback=callback)
- yield from future
+ await future
except IqError as err:
print('Error: %s' % err.iq['error']['condition'])
except IqTimeout:
@@ -66,7 +65,7 @@ class RosterBrowser(slixmpp.ClientXMPP):
print('Waiting for presence updates...\n')
- yield from asyncio.sleep(10)
+ await asyncio.sleep(10)
print('Roster for %s' % self.boundjid.bare)
groups = self.client_roster.groups()