diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index c11a4d34d..4456b3519 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -49,6 +49,8 @@ #include #include +#include + #include #include #include @@ -1709,17 +1711,17 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) // import Python module that manages GEOM plugins (need to be here because SalomePyQt API uses active module) PyGILState_STATE gstate = PyGILState_Ensure(); - PyObject* pluginsmanager = PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager"); - if (pluginsmanager == NULL) + PyObjWrapper pluginsmanager = PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager"); + if ( !pluginsmanager ) { PyErr_Print(); + } else { - PyObject* result = + PyObjWrapper result = PyObject_CallMethod(pluginsmanager, (char*)"initialize", (char*)"isss", 1, "geom", tr("MEN_NEW_ENTITY").toStdString().c_str(), tr("GEOM_PLUGINS_OTHER").toStdString().c_str()); - if (result == NULL) + if ( !result ) PyErr_Print(); - Py_XDECREF(result); } PyGILState_Release(gstate); // end of GEOM plugins loading