From: prascle Date: Wed, 2 Feb 2005 14:58:59 +0000 (+0000) Subject: PR: add X-Git-Tag: V2_2_0~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=257981fd042a24098690832f8f14f1c5d736c58d;p=modules%2Fkernel.git PR: add import salome salome.salome_init() before import moduleGUI --- diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx index 09c9227a7..1ec297726 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx @@ -66,6 +66,20 @@ void SALOME_PYQT_GUI::importModule() { PyLockWrapper aLock = interp->GetLockWrapper(); + PyObjWrapper amod = PyImport_ImportModule("salome"); + if(!amod){ + MESSAGE ( " Problem import salome... " ); + PyErr_Print(); + return; + } + + PyObjWrapper res(PyObject_CallMethod(amod,"salome_init","")); + if(!res){ + MESSAGE ( " Problem... " ); + PyErr_Print(); + return; + } + _module=PyImport_ImportModule((char*)_moduleName.c_str()); if(!_module){ MESSAGE ( " Problem... " );