From: barate Date: Thu, 3 Nov 2011 17:15:15 +0000 (+0000) Subject: Fix bug in studyedit X-Git-Tag: V6_4_0b1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d11b83010e5318d0f0ec53d790b49460ac67bb2f;p=modules%2Fkernel.git Fix bug in studyedit --- diff --git a/src/KERNEL_PY/kernel/studyedit.py b/src/KERNEL_PY/kernel/studyedit.py index f31c6ede6..8d7c1a3ab 100644 --- a/src/KERNEL_PY/kernel/studyedit.py +++ b/src/KERNEL_PY/kernel/studyedit.py @@ -40,9 +40,13 @@ def getActiveStudyId(): ``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())