~singpolyma/biboumi

fdf336afa017c24eb483f741e4037226f8a08401 — louiz’ 6 years ago 1d6aa89
Use ensure_future if available, otherwise use asyncio.async
1 files changed, 3 insertions(+), 1 deletions(-)

M tests/end_to_end/__main__.py
M tests/end_to_end/__main__.py => tests/end_to_end/__main__.py +3 -1
@@ 13,6 13,8 @@ import os
from functools import partial
from slixmpp.xmlstream.matcher.base import MatcherBase

if not hasattr(asyncio, "ensure_future"):
    asyncio.ensure_future = getattr(asyncio, "async")

class MatchAll(MatcherBase):
    """match everything"""


@@ 57,7 59,7 @@ class XMPPComponent(slixmpp.BaseXMPP):

        self.add_event_handler("session_end", self.on_end_session)

        asyncio.async(self.accept_routine())
        asyncio.ensure_future(self.accept_routine())

        self.scenario = scenario
        self.biboumi = biboumi