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

Refs #34118 -- Adopted asgiref coroutine detection shims. #16380

Merged
merged 2 commits into from Dec 20, 2022
Merged

Refs #34118 -- Adopted asgiref coroutine detection shims. #16380

merged 2 commits into from Dec 20, 2022

Conversation

carltongibson
Copy link
Member

@carltongibson carltongibson commented Dec 13, 2022

ticket-34118 Python 3.12 compatibility.

Refs python/cpython#99247
Refs django/asgiref#360

This PR requires at least the asgiref branch to test.

Python 3.12 deprecates asyncio.iscoroutinefunction() as an alias for
inspect.iscoroutinefunction(), whilst also removing the _is_coroutine marker.
The latter is replaced with the inspect.markcoroutinefunction decorator.
Until 3.12 is the minimum supported Python version, use the shims from asgiref.sync.

Copy link
Member

@andrewgodwin andrewgodwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@carltongibson carltongibson marked this pull request as ready for review December 20, 2022 09:22
@carltongibson
Copy link
Member Author

Rebased and updated the asgiref dependency for 3.6.0, which has the shims in place.

setup.cfg Show resolved Hide resolved
@felixxm felixxm merged commit 32d70b2 into django:main Dec 20, 2022
@felixxm
Copy link
Member

felixxm commented Dec 20, 2022

@carltongibson Thanks 👍

@carltongibson carltongibson deleted the 4.2/adopt-iscoroutinefunction-shims branch December 20, 2022 10:11
@carltongibson
Copy link
Member Author

Thanks @felixxm 🚀

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