From d11b83010e5318d0f0ec53d790b49460ac67bb2f Mon Sep 17 00:00:00 2001 From: barate Date: Thu, 3 Nov 2011 17:15:15 +0000 Subject: [PATCH] Fix bug in studyedit --- src/KERNEL_PY/kernel/studyedit.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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()) -- 2.39.2