Skip to content

Commit c9308e2

Browse files
committed
BUG: interpolate: fix missing free-threading support in _dierckxmodule.cc
Also clean up an unnecessary usage of `py3_dep` in the build declaration for `_dierckx`.
1 parent e4ff46f commit c9308e2

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

scipy/interpolate/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ py3.extension_module('_bspl',
144144
py3.extension_module('_dierckx',
145145
['src/_dierckxmodule.cc'],
146146
include_directories: 'src/',
147-
dependencies: [py3_dep, np_dep, __fitpack_dep],
147+
dependencies: [np_dep, __fitpack_dep],
148148
link_args: version_link_args,
149149
install: true,
150150
subdir: 'scipy/interpolate'

scipy/interpolate/src/_dierckxmodule.cc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,18 @@ static struct PyModuleDef dierckxmodule = {
754754
PyMODINIT_FUNC
755755
PyInit__dierckx(void)
756756
{
757+
PyObject *module;
758+
757759
import_array();
758760

759-
return PyModule_Create(&dierckxmodule);
761+
module = PyModule_Create(&dierckxmodule);
762+
if (module == NULL) {
763+
return NULL;
764+
}
765+
766+
#if Py_GIL_DISABLED
767+
PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED);
768+
#endif
769+
770+
return module;
760771
}

0 commit comments

Comments
 (0)