8000 gh-99113: Add a check for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED by ericsnowcurrently · Pull Request #104206 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-99113: Add a check for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED #104206

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

Merged
Prev Previous commit
Next Next commit
Fail unsupported extensions.
  • Loading branch information
ericsnowcurrently committed May 5, 2023
commit e32c4879765f54a6a57b586ab1ac792c8ff95d7c
9 changes: 8 additions & 1 deletion Objects/moduleobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,14 @@ PyModule_FromDefAndSpec2(PyModuleDef* def, PyObject *spec, int module_api_versio
goto error;
}
}
// XXX Do a similar check once we have PyInterpreterState.ceval.own_gil.
// XXX This case needs a test.
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);
Expand Down
0