8000 Support multiple interpreters. · python/cpython@091dab6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 091dab6

Browse files
Support multiple interpreters.
1 parent 62cb235 commit 091dab6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Modules/imathmodule.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,21 +1277,26 @@ static PyMethodDef imath_methods[] = {
12771277
{NULL, NULL} /* sentinel */
12781278
};
12791279

1280+
static PyModuleDef_Slot imath_slots[] = {
1281+
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
1282+
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
1283+
{0, NULL}
1284+
};
12801285

12811286
PyDoc_STRVAR(module_doc,
12821287
"This module provides access to integer related mathematical functions.");
12831288

1284-
12851289
static struct PyModuleDef imathmodule = {
12861290
PyModuleDef_HEAD_INIT,
12871291
.m_name = "imath",
12881292
.m_doc = module_doc,
12891293
.m_size = 0,
12901294
.m_methods = imath_methods,
1295+
.m_slots = imath_slots,
12911296
};
12921297

12931298
PyMODINIT_FUNC
12941299
PyInit_imath(void)
12951300
{
1296-
return PyModule_Create(&imathmodule);
1301+
return PyModuleDef_Init(&imathmodule);
12971302
}

0 commit comments

Comments
 (0)
0