Salome HOME
For future compatibility with python 3.9. V9_7_0a1 V9_7_0a2 V9_7_0b1
authorOvidiu MIRCESCU <ovidiu.mircescu@edf.fr>
Tue, 6 Apr 2021 12:16:14 +0000 (14:16 +0200)
committerOvidiu MIRCESCU <ovidiu.mircescu@edf.fr>
Tue, 6 Apr 2021 12:16:14 +0000 (14:16 +0200)
see https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads

src/runtime/RuntimeSALOME.cxx
src/ydfx_gui/YDFXGUIPushButtons.cxx

index fb2727afab1af3048d961dfbd6fd4d137f9f5c38..99f57715231a2a5b4b84e12db0a0226586217b13 100644 (file)
@@ -314,7 +314,9 @@ void RuntimeSALOME::init(long flags, int argc, char* argv[])
               }
               PySys_SetArgv(pyArgc, changed_pyArgv);
             }
+#if PY_VERSION_HEX < 0x03070000
           PyEval_InitThreads(); /* Create (and acquire) the interpreter lock (for threads)*/
+#endif
           PyEval_SaveThread(); /* Release the thread state */
           //here we do not have the Global Interpreter Lock
         }
index 6f4b541a18b14587d061b9541e97ad053e14bbd7..76189f33f1231dc480b45ac044a6a7224db67d65 100644 (file)
@@ -304,8 +304,10 @@ void YDFXGUIRunningButton::runEvaluation()
 {
   if(!getSess()->isLaunched())
     getSess()->launch();
+#if PY_VERSION_HEX < 0x03070000
   if(!PyEval_ThreadsInitialized())
     PyEval_InitThreads();
+#endif
   connect(getThread(),SIGNAL(finished()),this,SLOT(evaluationFinished()));
   setEnabled(false);
   getThread()->start();