gh-104108: Add the Py_mod_multiple_interpreters Module Def Slot (gh-104148)

I'll be adding a value to indicate support for per-interpreter GIL in gh-99114.
This commit is contained in:
Eric Snow 2023-05-05 14:04:55 -06:00 committed by GitHub
parent 55671fe047
commit 1c420e138f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 122 additions and 22 deletions

View file

@ -884,3 +884,22 @@ PyInit__test_module_state_shared(void)
}
return module;
}
/* multiple interpreters supports */
static PyModuleDef_Slot non_isolated_slots[] = {
{Py_mod_exec, execfunc},
{Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
{0, NULL},
};
static PyModuleDef non_isolated_def = TEST_MODULE_DEF("_test_non_isolated",
non_isolated_slots,
testexport_methods);
PyMODINIT_FUNC
PyInit__test_non_isolated(void)
{
return PyModuleDef_Init(&non_isolated_def);
}