Skip to content

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

Merged
felixxm merged 2 commits intodjango:mainfrom
carltongibson:4.2/adopt-iscoroutinefunction-shims
Dec 20, 2022
Merged

Refs #34118 -- Adopted asgiref coroutine detection shims.#16380
felixxm merged 2 commits intodjango:mainfrom
carltongibson:4.2/adopt-iscoroutinefunction-shims

Conversation

@carltongibson
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

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

Comment thread setup.cfg Outdated
@felixxm felixxm merged commit 32d70b2 into django:main Dec 20, 2022
@felixxm
Copy link
Copy Markdown
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
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

3 participants