From 22015d5532bbe0deccfe3d8a4c6569993895f070 Mon Sep 17 00:00:00 2001 From: prascle Date: Fri, 31 Mar 2006 11:05:57 +0000 Subject: [PATCH] PR: python traceback --- src/KERNEL_PY/salome.py | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) 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 -- 2.39.2