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/s5b_transfer/s5b_sender.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'examples/s5b_transfer') diff --git a/examples/s5b_transfer/s5b_sender.py b/examples/s5b_transfer/s5b_sender.py index 70a9704f..d729988e 100755 --- a/examples/s5b_transfer/s5b_sender.py +++ b/examples/s5b_transfer/s5b_sender.py @@ -36,8 +36,7 @@ class S5BSender(slixmpp.ClientXMPP): # and the XML streams are ready for use. self.add_event_handler("session_start", self.start) - @asyncio.coroutine - def start(self, event): + async def start(self, event): """ Process the session_start event. @@ -53,14 +52,14 @@ class S5BSender(slixmpp.ClientXMPP): try: # Open the S5B stream in which to write to. - proxy = yield from self['xep_0065'].handshake(self.receiver) + proxy = await self['xep_0065'].handshake(self.receiver) # Send the entire file. while True: data = self.file.read(1048576) if not data: break - yield from proxy.write(data) + await proxy.write(data) # And finally close the stream. proxy.transport.write_eof() -- cgit v1.2.3