mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-99113: Add a check for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104206)
Py_MOD_PER_INTERPRETER_GIL_SUPPORTED is a new supported value for Py_mod_multiple_interpreters, added in gh-104205.
This commit is contained in:
parent
3b14b51d11
commit
fff193bbfe
5 changed files with 99 additions and 2 deletions
|
@ -323,7 +323,13 @@ PyModule_FromDefAndSpec2(PyModuleDef* def, PyObject *spec, int module_api_versio
|
|||
goto error;
|
||||
}
|
||||
}
|
||||
// XXX Do a similar check once we have PyInterpreterState.ceval.own_gil.
|
||||
else if (multiple_interpreters != Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
|
||||
&& interp->ceval.own_gil
|
||||
&& !_Py_IsMainInterpreter(interp)
|
||||
&& _PyImport_CheckSubinterpIncompatibleExtensionAllowed(name) < 0)
|
||||
{
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (create) {
|
||||
m = create(spec, def);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue