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/disco_browser.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'examples/disco_browser.py') diff --git a/examples/disco_browser.py b/examples/disco_browser.py index a9e8711f..14eeabc8 100755 --- a/examples/disco_browser.py +++ b/examples/disco_browser.py @@ -54,8 +54,7 @@ class Disco(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. @@ -77,13 +76,13 @@ class Disco(slixmpp.ClientXMPP): try: if self.get in self.info_types: # function using the callback parameter. - info = yield from self['xep_0030'].get_info(jid=self.target_jid, + info = await self['xep_0030'].get_info(jid=self.target_jid, node=self.target_node) if self.get in self.items_types: # The same applies from above. Listen for the # disco_items event or pass a callback function # if you need to process a non-blocking request. - items = yield from self['xep_0030'].get_items(jid=self.target_jid, + items = await self['xep_0030'].get_items(jid=self.target_jid, node=self.target_node) if self.get not in self.info_types and self.get not in self.items_types: logging.error("Invalid disco request type.") -- cgit v1.2.3