]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-98627: Add an Optional Check for Extension Module Subinterpreter Compatibility...
authorEric Snow <ericsnowcurrently@gmail.com>
Thu, 16 Feb 2023 01:16:00 +0000 (18:16 -0700)
committerGitHub <noreply@github.com>
Thu, 16 Feb 2023 01:16:00 +0000 (18:16 -0700)
commit89ac665891dec1988bedec2ce9b2c4d016502a49
tree246997ab21e8b587b8a3f58ac93d7b278c9d0938
parent3dea4ba6c1b9237893d23574f931f33c940b74e8
gh-98627: Add an Optional Check for Extension Module Subinterpreter Compatibility (gh-99040)

Enforcing (optionally) the restriction set by PEP 489 makes sense. Furthermore, this sets the stage for a potential restriction related to a per-interpreter GIL.

This change includes the following:

* add tests for extension module subinterpreter compatibility
* add _PyInterpreterConfig.check_multi_interp_extensions
* add Py_RTFLAGS_MULTI_INTERP_EXTENSIONS
* add _PyImport_CheckSubinterpIncompatibleExtensionAllowed()
* fail iff the module does not implement multi-phase init and the current interpreter is configured to check

https://github.com/python/cpython/issues/98627
15 files changed:
Include/cpython/initconfig.h
Include/cpython/pystate.h
Include/internal/pycore_import.h
Lib/test/support/import_helper.py
Lib/test/test_capi/check_config.py [new file with mode: 0644]
Lib/test/test_capi/test_misc.py
Lib/test/test_embed.py
Lib/test/test_import/__init__.py
Lib/test/test_threading.py
Misc/NEWS.d/next/Core and Builtins/2022-11-02-20-23-47.gh-issue-98627.VJkdRM.rst [new file with mode: 0644]
Modules/_testcapimodule.c
Python/clinic/import.c.h
Python/import.c
Python/importdl.c
Python/pylifecycle.c