]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PR: python traceback
authorprascle <prascle>
Fri, 31 Mar 2006 11:05:57 +0000 (11:05 +0000)
committerprascle <prascle>
Fri, 31 Mar 2006 11:05:57 +0000 (11:05 +0000)
src/KERNEL_PY/salome.py

index f7e0099a4c1ea373f30c62d38ad6036b6c25a21a..451e5a2f5207f812e5d409fa731599181943948a 100755 (executable)
@@ -55,10 +55,26 @@ def salome_init(theStudyId=0,embedded=0):
     global orb, lcc, naming_service, cm
     global sg
     global myStudyManager, myStudyId, myStudy, myStudyName
-    
-    if salome_initial:
-        salome_initial=0
-        sg = salome_iapp_init(embedded)
-        orb, lcc, naming_service, cm = salome_kernel_init()
-        myStudyManager, myStudyId, myStudy, myStudyName =salome_study_init(theStudyId)
 
+    try:
+        if salome_initial:
+            salome_initial=0
+            sg = salome_iapp_init(embedded)
+            orb, lcc, naming_service, cm = salome_kernel_init()
+            myStudyManager, myStudyId, myStudy, myStudyName =salome_study_init(theStudyId)
+            pass
+        pass
+    except RuntimeError, inst:
+        # wait a little to avoid trace mix
+        import time
+        time.sleep(0.2)
+        x = inst
+        print "salome.salome_init():", x
+        print """
+        ============================================
+        May be there is no running SALOME session
+        salome.salome_init() is intented to be used
+        within an already running session
+        ============================================
+        """
+        raise