]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Fix YACS tests
authorAnthony Geay <anthony.geay@edf.fr>
Mon, 3 Apr 2023 15:42:23 +0000 (17:42 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Mon, 3 Apr 2023 15:42:23 +0000 (17:42 +0200)
src/Container/SALOME_ContainerManager.cxx

index 80008d123bfe44ad771abf6ef4c57d00cb9c6235..54de26182be19b25b5210c65d4990407389557c0 100644 (file)
 #include "SALOME_ModuleCatalog.hh"
 #include "Basics_Utils.hxx"
 #include "Basics_DirUtils.hxx"
-
-#include <pthread.h>  // must be before Python.h !
 #include "PythonCppUtils.hxx"
-
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <signal.h>
@@ -850,14 +847,8 @@ std::string GetCommandFromTemplate(const std::string& theScriptName,
                                    std::queue<std::string>& theScriptParameters)
 {
   std::string command;
-
+  AutoGIL agil;
   // manage GIL
-  PyThreadState *_save = NULL;
-  PyThreadState *pts = PyGILState_GetThisThreadState(); 
-  if (!pts) {
-    _save = PyEval_SaveThread();
-  }
-  PyGILState_STATE gstate = PyGILState_Ensure();
 
   PyObject* mod(PyImport_ImportModule(theScriptName.c_str()));
   if (!mod)
@@ -917,11 +908,6 @@ std::string GetCommandFromTemplate(const std::string& theScriptName,
     }
   }
 
-  PyGILState_Release(gstate);
-  if (_save) {
-    PyEval_RestoreThread(_save);
-  }
-
   MESSAGE("Command from template is ... " << command << std::endl);
   return command;
 }