Skip to content

Commit f2eeb4e

Browse files
authored
Add Py_mod_gil slot to C extension modules (#59135)
1 parent 23e592f commit f2eeb4e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

pandas/_libs/src/datetime/pd_datetime.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,12 @@ static int pandas_datetime_exec(PyObject *Py_UNUSED(module)) {
245245
}
246246

247247
static PyModuleDef_Slot pandas_datetime_slots[] = {
248-
{Py_mod_exec, pandas_datetime_exec}, {0, NULL}};
248+
{Py_mod_exec, pandas_datetime_exec},
249+
#if PY_VERSION_HEX >= 0x030D0000
250+
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
251+
#endif
252+
{0, NULL},
253+
};
249254

250255
static struct PyModuleDef pandas_datetimemodule = {
251256
PyModuleDef_HEAD_INIT,

pandas/_libs/src/parser/pd_parser.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,12 @@ static int pandas_parser_exec(PyObject *Py_UNUSED(module)) {
161161
}
162162

163163
static PyModuleDef_Slot pandas_parser_slots[] = {
164-
{Py_mod_exec, pandas_parser_exec}, {0, NULL}};
164+
{Py_mod_exec, pandas_parser_exec},
165+
#if PY_VERSION_HEX >= 0x030D0000
166+
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
167+
#endif
168+
{0, NULL},
169+
};
165170

166171
static struct PyModuleDef pandas_parsermodule = {
167172
PyModuleDef_HEAD_INIT,

0 commit comments

Comments
 (0)