Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11 support: Don't use asyncio.coroutine if it's not available #267

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

encukou
Copy link

@encukou encukou commented Dec 2, 2021

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.

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.
This is	still necessary	according to the Contributing Guidelines.
@AdamWill
Copy link
Contributor

AdamWill commented Nov 5, 2024

I rebased this against 2.0.1 as #359 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants