``salome.myStudyId`` variable.
"""
salome.salome_init()
- # _GBO_WARN: note that salome.getActiveStudy() returns an id. It
- # should return the study or be renammed in getActiveStudyId.
- return salome.getActiveStudy()
+ # Warning: we don't use salome.getActiveStudy() here because it doesn't
+ # work properly when called from Salome modules (multi-study interpreter
+ # issue)
+ if salome.hasDesktop():
+ return salome.sg.getActiveStudyId()
+ else:
+ return salome.myStudyId
def getActiveStudy():
return salome.myStudyManager.GetStudyByID(getActiveStudyId())