From c63e614636f09e03728d83f2c1178b4fc789019b Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Mon, 20 Nov 2023 10:41:24 +0100 Subject: [PATCH] Avoid deprecated PyEval_InitThreads (#185) warning: 'void PyEval_InitThreads()' is deprecated [-Wdeprecated-declarations] --- pythonfmu/pythonfmu-export/src/pythonfmu/PyState.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pythonfmu/pythonfmu-export/src/pythonfmu/PyState.hpp b/pythonfmu/pythonfmu-export/src/pythonfmu/PyState.hpp index 2abc9486..7b9709d4 100644 --- a/pythonfmu/pythonfmu-export/src/pythonfmu/PyState.hpp +++ b/pythonfmu/pythonfmu-export/src/pythonfmu/PyState.hpp @@ -18,7 +18,9 @@ class PyState if (!was_initialized_) { Py_SetProgramName(L"./PythonFMU"); Py_Initialize(); +#if PY_VERSION_HEX < 0x03070000 PyEval_InitThreads(); +#endif _mainPyThread = PyEval_SaveThread(); } }