Closed srittau closed 2 months ago
The 3.13 test fails, because this hasn't been implemented in 3.13 yet. It should be fixed with 3.13.rc1. What's the best course of action?
The 3.13 test fails, because this hasn't been implemented in 3.13 yet. It should be fixed with 3.13.rc1. What's the best course of action?
I'd add a decorator like the one we already have here (which we can probably delete at this point):
Something like this:
skip_if_py313_beta = skipIf(
sys.version_info[:4] == (3, 13, 0, 'beta'),
"Bugfixes will be released in 3.13.0rc1"
)
CI is passing now.
On earlier versions of Python, there were two different functions,
inspect.iscoroutinefunction
andasyncio.coroutines.iscoroutinefunction
. This was confusing, because they did two different things:inspect.iscoroutinefunction
was strict about only returningTrue
for functions that actually had theCO_COROUTINE
code-flag set, whereasasyncio.coroutines.iscoroutinefunction
also considered functions decorated with@types.coroutine
to be coroutines, even though these functions did not have that code-flag set.There's not much we can do for
inspect.iscoroutinefunction
on the earlier versions of Python (because, before the twoiscoroutinefunction
functions were merged, it was stricter than it is now), but we can hackasyncio.coroutines.iscoroutinefunction
by doingdecorated_function._is_coroutine = asyncio.coroutines._is_coroutine
: https://github.com/python/cpython/blob/d542a9be51776e8d589363ee15164dec8dbd3a76/Lib/asyncio/coroutines.py#L17-L24