summaryrefslogtreecommitdiff
path: root/examples/confirm_ask.py
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-08-19 17:47:26 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-08-19 17:47:26 +0100
commit9f6fa6513946e78de6e77a7e924fedc84c89ad25 (patch)
tree079a4f43a51cb7b4242c87aaa41810a30be11644 /examples/confirm_ask.py
parent35fa33e3c232377acf77805d858a4efec54180ca (diff)
downloadslixmpp-9f6fa6513946e78de6e77a7e924fedc84c89ad25.tar.gz
slixmpp-9f6fa6513946e78de6e77a7e924fedc84c89ad25.tar.bz2
slixmpp-9f6fa6513946e78de6e77a7e924fedc84c89ad25.tar.xz
slixmpp-9f6fa6513946e78de6e77a7e924fedc84c89ad25.zip
examples, tests: Replace all @asyncio.coroutines with proper async functions.
Diffstat (limited to 'examples/confirm_ask.py')
-rwxr-xr-xexamples/confirm_ask.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/confirm_ask.py b/examples/confirm_ask.py
index e3cd184a..27fdfde7 100755
--- a/examples/confirm_ask.py
+++ b/examples/confirm_ask.py
@@ -51,18 +51,17 @@ class AskConfirm(slixmpp.ClientXMPP):
else:
self.confirmed.set_result(True)
- @asyncio.coroutine
- def start(self, event):
+ async def start(self, event):
log.info('Sending confirm request %s to %s who wants to access %s using '
'method %s...' % (self.id, self.recipient, self.url, self.method))
try:
- confirmed = yield from self['xep_0070'].ask_confirm(self.recipient,
+ confirmed = await self['xep_0070'].ask_confirm(self.recipient,
id=self.id,
url=self.url,
method=self.method,
message='Plz say yes or no for {method} {url} ({id}).')
if isinstance(confirmed, slixmpp.Message):
- confirmed = yield from self.confirmed
+ confirmed = await self.confirmed
else:
confirmed = True
except IqError: