Skip to content

Commit

Permalink
BUG: interpolate: fix missing free-threading support in `_dierckxmodu…
Browse files Browse the repository at this point in the history
…le.cc`

Also clean up an unnecessary usage of `py3_dep` in the build declaration
for `_dierckx`.
  • Loading branch information
rgommers committed Dec 23, 2024
1 parent b497e0b commit 9625984
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scipy/interpolate/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ py3.extension_module('_bspl',
py3.extension_module('_dierckx',
['src/_dierckxmodule.cc'],
include_directories: 'src/',
dependencies: [py3_dep, np_dep, __fitpack_dep],
dependencies: [np_dep, __fitpack_dep],
link_args: version_link_args,
install: true,
subdir: 'scipy/interpolate'
Expand Down
13 changes: 12 additions & 1 deletion scipy/interpolate/src/_dierckxmodule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,18 @@ static struct PyModuleDef dierckxmodule = {
PyMODINIT_FUNC
PyInit__dierckx(void)
{
PyObject *module;

import_array();

return PyModule_Create(&dierckxmodule);
module = PyModule_Create(&dierckxmodule);
if (module == NULL) {
return NULL;
}

#if Py_GIL_DISABLED
PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED);
#endif

return module;
}

0 comments on commit 9625984

Please sign in to comment.