diff options
Diffstat (limited to 'examples/ping.py')
-rwxr-xr-x | examples/ping.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/ping.py b/examples/ping.py index 39118ac4..cb1bb968 100755 --- a/examples/ping.py +++ b/examples/ping.py @@ -13,7 +13,6 @@ import logging from getpass import getpass from argparse import ArgumentParser from slixmpp.exceptions import IqError, IqTimeout -from slixmpp import asyncio import slixmpp @@ -38,8 +37,7 @@ class PingTest(slixmpp.ClientXMPP): # our roster. self.add_event_handler("session_start", self.start) - @asyncio.coroutine - def start(self, event): + async def start(self, event): """ Process the session_start event. @@ -56,7 +54,7 @@ class PingTest(slixmpp.ClientXMPP): self.get_roster() try: - rtt = yield from self['xep_0199'].ping(self.pingjid, + rtt = await self['xep_0199'].ping(self.pingjid, timeout=10) logging.info("Success! RTT: %s", rtt) except IqError as e: |