diff options
Diffstat (limited to 'slixmpp/xmlstream/handler/coroutine_callback.py')
-rw-r--r-- | slixmpp/xmlstream/handler/coroutine_callback.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/slixmpp/xmlstream/handler/coroutine_callback.py b/slixmpp/xmlstream/handler/coroutine_callback.py index 1ca4ab0a..0708a6e4 100644 --- a/slixmpp/xmlstream/handler/coroutine_callback.py +++ b/slixmpp/xmlstream/handler/coroutine_callback.py @@ -45,10 +45,9 @@ class CoroutineCallback(BaseHandler): if not asyncio.iscoroutinefunction(pointer): raise ValueError("Given function is not a coroutine") - @asyncio.coroutine - def pointer_wrapper(stanza, *args, **kwargs): + async def pointer_wrapper(stanza, *args, **kwargs): try: - yield from pointer(stanza, *args, **kwargs) + await pointer(stanza, *args, **kwargs) except Exception as e: stanza.exception(e) |