X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelHighAPI%2FModelHighAPI_Tools.cpp;h=23f65ebc61497dc1e3c0066451243f2feb610068;hb=268de14fe8b857dd33fafb349386be6e3fb4caf5;hp=8923fd6e13bf01788622a586a564361eccb44709;hpb=b519afb1eed5da2e6dd09519543cb81b7fca020a;p=modules%2Fshaper.git diff --git a/src/ModelHighAPI/ModelHighAPI_Tools.cpp b/src/ModelHighAPI/ModelHighAPI_Tools.cpp index 8923fd6e1..23f65ebc6 100644 --- a/src/ModelHighAPI/ModelHighAPI_Tools.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Tools.cpp @@ -43,6 +43,9 @@ #include +// Have to be included before std headers +#include + #include #include @@ -344,22 +347,25 @@ bool checkPythonDump() std::string anError = storeFeatures( aSession->moduleDocument()->kind(), aSession->moduleDocument(), aStore, false); if (!anError.empty()) { - Events_InfoMessage anError("checkPythonDump", anError); - anError.send(); + Events_InfoMessage anErrorMsg(std::string("checkPythonDump"), anError); + anErrorMsg.send(); return false; } // close all before importation of the script aSession->closeAll(); // execute the dumped - Config_ModuleReader::loadScript("check_dump"); + PyGILState_STATE gstate = PyGILState_Ensure(); /* acquire python thread */ + PyObject* PyFileObject = PyFile_FromString("./check_dump.py", "r"); + PyRun_SimpleFileEx(PyFile_AsFile(PyFileObject), "./check_dump.py", 1); + PyGILState_Release(gstate); /* release python thread */ // compare with the stored data anError = storeFeatures( aSession->moduleDocument()->kind(), aSession->moduleDocument(), aStore, true); if (!anError.empty()) { std::cout<