From: prascle Date: Fri, 31 Mar 2006 11:05:57 +0000 (+0000) Subject: PR: python traceback X-Git-Tag: T3_2_0b1_pre1~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=22015d5532bbe0deccfe3d8a4c6569993895f070;p=modules%2Fkernel.git PR: python traceback --- diff --git a/src/KERNEL_PY/salome.py b/src/KERNEL_PY/salome.py index f7e0099a4..451e5a2f5 100755 --- a/src/KERNEL_PY/salome.py +++ b/src/KERNEL_PY/salome.py @@ -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