From 3ca6ffd9ba523dd5156638b4aa438b4c8fc9886b Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 11 Sep 2013 16:27:56 +0000 Subject: [PATCH] 0022221: [CEA 819] Error "'NoneType' object is not callable" at Salome closure --- src/GEOMGUI/GeometryGUI.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 -- 2.39.2