diff --git a/src/GEOM_PY/geomtools.py b/src/GEOM_PY/geomtools.py index 4f9a01044..67fb7bdd5 100644 --- a/src/GEOM_PY/geomtools.py +++ b/src/GEOM_PY/geomtools.py @@ -32,8 +32,13 @@ logger = Logger("salome.geom.geomtools", color = termcolor.RED) from salome.kernel.studyedit import getActiveStudyId, getStudyEditor from salome.kernel.services import IDToObject, IDToSObject +from salome.kernel.deprecation import is_called_by_sphinx + try: - from salome.gui import helper as guihelper + if not is_called_by_sphinx(): + from salome.gui import helper as guihelper + pass + pass except: pass diff --git a/src/GEOM_PY/sketcher.py b/src/GEOM_PY/sketcher.py index 7a20387ec..cc6404bd8 100644 --- a/src/GEOM_PY/sketcher.py +++ b/src/GEOM_PY/sketcher.py @@ -47,14 +47,18 @@ Additionnal examples can be found as unit tests in the source code. geompyEnable = True try: - import salome - salome.salome_init() - import GEOM - from salome.geom import geomBuilder - geompy = geomBuilder.New(salome.myStudy) + from salome.kernel.deprecation import is_called_by_sphinx + if not is_called_by_sphinx(): + import salome + salome.salome_init() + import GEOM + from salome.geom import geomBuilder + geompy = geomBuilder.New(salome.myStudy) + pass + pass except: geompyEnable = False - + pass class Sketcher: