浏览代码

No need to call PyEval_InitThreads starting from python 3.9

Samuel Thibault 4 年之前
父节点
当前提交
c4843b98b3
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      starpupy/src/starpu_task_wrapper.c

+ 2 - 0
starpupy/src/starpu_task_wrapper.c

@@ -715,7 +715,9 @@ static struct PyModuleDef starpupymodule =
 PyMODINIT_FUNC
 PyMODINIT_FUNC
 PyInit_starpupy(void)
 PyInit_starpupy(void)
 {
 {
+#if PY_MAJOR_VERSION < 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 9)
 	PyEval_InitThreads();
 	PyEval_InitThreads();
+#endif
 	//PyThreadState* st = PyEval_SaveThread();
 	//PyThreadState* st = PyEval_SaveThread();
 	Py_BEGIN_ALLOW_THREADS
 	Py_BEGIN_ALLOW_THREADS
 	/*starpu initialization*/
 	/*starpu initialization*/