From 9f6fa6513946e78de6e77a7e924fedc84c89ad25 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 19 Aug 2018 17:47:26 +0100 Subject: examples, tests: Replace all @asyncio.coroutines with proper async functions. --- examples/ping.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'examples/ping.py') diff --git a/examples/ping.py b/examples/ping.py index 39118ac4..65e892a1 100755 --- a/examples/ping.py +++ b/examples/ping.py @@ -38,8 +38,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 +55,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: -- cgit v1.2.3