8000 Fall back to asyncio.async when asyncio.ensure_future is not availabl… · chdsbd/asyncio-redis@69f05f7 · GitHub
  • [go: up one dir, main page]

    Skip to content
    This repository was archived by the owner on Feb 4, 2023. It is now read-only.

    Commit 69f05f7

    Browse files
    Fall back to asyncio.async when asyncio.ensure_future is not available. (2)
    1 parent 68687da commit 69f05f7

    File tree

    1 file changed

    +7
    -1
    lines changed

    1 file changed

    +7
    -1
    lines changed

    asyncio_redis/replies.py

    Lines changed: 7 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -14,6 +14,12 @@
    1414
    )
    1515

    1616

    17+
    try:
    18+
    ensure_future = asyncio.ensure_future
    19+
    except AttributeError:
    20+
    ensure_future = asyncio.async
    21+
    22+
    1723
    class StatusReply:
    1824
    """
    1925
    Wrapper for Redis status replies.
    @@ -62,7 +68,7 @@ def getter(f):
    6268

    6369
    for _ in range(self._result.count // 2):
    6470
    read_future = self._result._read(count=2)
    65-
    yield asyncio.ensure_future(getter(read_future), loop=self._result._loop)
    71+
    yield ensure_future(getter(read_future), loop=self._result._loop)
    6672

    6773
    @asyncio.coroutine
    6874
    def asdict(self):

    0 commit comments

    Comments
     (0)
    0