From ee921e4f1284fe3d984d9422b24a1c56c6916c21 Mon Sep 17 00:00:00 2001 From: Paulchen-Panther <16664240+Paulchen-Panther@users.noreply.github.com> Date: Sun, 17 Nov 2024 12:34:12 +0100 Subject: [PATCH] Python 3.11.10 test --- libsrc/python/PythonProgram.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/libsrc/python/PythonProgram.cpp b/libsrc/python/PythonProgram.cpp index 80574474..3571cb38 100644 --- a/libsrc/python/PythonProgram.cpp +++ b/libsrc/python/PythonProgram.cpp @@ -88,11 +88,12 @@ void PythonProgram::execute(const QByteArray& python_code) if (!main_module) { // Restore the previous thread state -#if (PY_VERSION_HEX < 0x030C0000) - PyThreadState_Swap(mainThreadState); -#else +// #if (PY_VERSION_HEX < 0x030C0000) +// PyThreadState_Swap(mainThreadState); +// #else PyThreadState_Swap(prev_thread_state); -#endif + qDebug() << "PyThreadState_Swap(prev_thread_state);"; +// #endif return; } @@ -175,10 +176,11 @@ void PythonProgram::execute(const QByteArray& python_code) Py_DECREF(main_module); // Restore the previous thread state -#if (PY_VERSION_HEX < 0x030C0000) - PyThreadState_Swap(mainThreadState); -#else +// #if (PY_VERSION_HEX < 0x030C0000) +// PyThreadState_Swap(mainThreadState); +// #else PyThreadState_Swap(prev_thread_state); -#endif + qDebug() << "PyThreadState_Swap(prev_thread_state);"; +// #endif }