From: Anthony Geay Date: Mon, 3 Apr 2023 15:42:23 +0000 (+0200) Subject: Fix YACS tests X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=76a0718e48a33d472d69f24ff82da19478ad1d70;p=modules%2Fkernel.git Fix YACS tests --- diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 80008d123..54de26182 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -29,10 +29,7 @@ #include "SALOME_ModuleCatalog.hh" #include "Basics_Utils.hxx" #include "Basics_DirUtils.hxx" - -#include // must be before Python.h ! #include "PythonCppUtils.hxx" - #include #include #include @@ -850,14 +847,8 @@ std::string GetCommandFromTemplate(const std::string& theScriptName, std::queue& 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; }