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

[3.9] bpo-44050: Extension modules can share state when they don't support sub-interpreters. (GH-27794) #28741

Merged
merged 2 commits into from
Oct 5, 2021

Conversation

ambv
Copy link
Contributor

@ambv ambv commented Oct 5, 2021

(cherry picked from commit b9bb748)

Co-authored-by: Hai Shi shihai1992@gmail.com

Note: this is a little different from 3.10 and 3.11 because in 3.10+ _Py_IsMainInterpreter takes PyInterpreterState instead of the entire PyThreadState as an argument (see GH-24577 for that).

Also, the new test uses PyModule_AddObjectRef which was only added in Python 3.10 (see GH-23122). I replaced this usage with the old PyModule_AddObject with additional increfs and decrefs per what BPO-42327 prescribes.

https://bugs.python.org/issue44050

…pport sub-interpreters. (pythonGH-27794)

Automerge-Triggered-By: GH:encukou.
(cherry picked from commit b9bb748)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
@ambv ambv merged commit 52d9d3b into python:3.9 Oct 5, 2021
@ambv ambv deleted the backport-b9bb748-3.9 branch October 5, 2021 20:41
@encukou
Copy link
Member

encukou commented Oct 12, 2021

Thanks for taking this, Łukasz!
(I would only get to it now ☺)

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.

5 participants