From 07bf243a44ee4381a73e9ebabf27b2f7b104acfb Mon Sep 17 00:00:00 2001 From: Lord-Grey Date: Wed, 20 Nov 2024 19:28:53 +0100 Subject: [PATCH] Revert "Python 3.11.10 test" This reverts commit ee921e4f1284fe3d984d9422b24a1c56c6916c21. --- libsrc/python/PythonProgram.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/libsrc/python/PythonProgram.cpp b/libsrc/python/PythonProgram.cpp index 3571cb38..80574474 100644 --- a/libsrc/python/PythonProgram.cpp +++ b/libsrc/python/PythonProgram.cpp @@ -88,12 +88,11 @@ 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); - qDebug() << "PyThreadState_Swap(prev_thread_state);"; -// #endif +#endif return; } @@ -176,11 +175,10 @@ 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); - qDebug() << "PyThreadState_Swap(prev_thread_state);"; -// #endif +#endif }