Skip to content

Commit 09e0f1b

Browse files
committed
Add Py_mod_gil slot to C extension modules
1 parent 32ceb4a commit 09e0f1b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pandas/_libs/src/datetime/pd_datetime.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,10 @@ 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+
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
250+
{0, NULL},
251+
};
249252

250253
static struct PyModuleDef pandas_datetimemodule = {
251254
PyModuleDef_HEAD_INIT,

pandas/_libs/src/parser/pd_parser.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ 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+
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
166+
{0, NULL},
167+
};
165168

166169
static struct PyModuleDef pandas_parsermodule = {
167170
PyModuleDef_HEAD_INIT,

0 commit comments

Comments
 (0)