diff options
Diffstat (limited to 'examples/s5b_transfer/s5b_sender.py')
-rwxr-xr-x | examples/s5b_transfer/s5b_sender.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/s5b_transfer/s5b_sender.py b/examples/s5b_transfer/s5b_sender.py index 70a9704f..7ef5c99c 100755 --- a/examples/s5b_transfer/s5b_sender.py +++ b/examples/s5b_transfer/s5b_sender.py @@ -9,7 +9,6 @@ See the file LICENSE for copying permission. """ -import asyncio import logging from getpass import getpass from argparse import ArgumentParser @@ -36,8 +35,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 +51,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() |