cached-property
cached-property copied to clipboard
Python 3.11 support: Don't use asyncio.coroutine if it's not available
Python 3.11 drops the deprecated @asyncio.coroutine and asyncio.iscoroutinefunction.
Using a wrapper with @asyncio.coroutine in __get__
wasn't
necessary (the future from asyncio.ensure_future is awaitable,
and the wrapper doesn't do anything asynchronous), so the
logic can be simplified to just call asyncio.ensure_future
(to schedule the task and store the result when it's
available).
Tests for @asyncio.coroutine are skipped on 3.11+.
An unnecessary call to asyncio.coroutine in tests is
removed: it's not necessary to call this for async def
functions.