From 7878b2224103b17b200d14e6566084494de9e311 Mon Sep 17 00:00:00 2001 From: rnv Date: Fri, 5 Jun 2020 16:37:37 +0300 Subject: [PATCH] Cosmetic changes. --- src/KERNEL_PY/salome_iapp.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/KERNEL_PY/salome_iapp.py b/src/KERNEL_PY/salome_iapp.py index 083c5c73a..145e80b23 100644 --- a/src/KERNEL_PY/salome_iapp.py +++ b/src/KERNEL_PY/salome_iapp.py @@ -187,12 +187,15 @@ def salome_iapp_close(): def load_module(name, syncCall=True): - import salome_kernel - orb, lcc, naming_service, cm, esm, dsm = salome_kernel.salome_kernel_init() - session_server = naming_service.Resolve("/Kernel/Session") - if session_server: - message = "load_module/"+name - if syncCall: - session_server.emitMessage(message) - else: - session_server.emitMessageOneWay(message) \ No newline at end of file + try: + import salome + salome.salome_init() + session_server = salome.naming_service.Resolve("/Kernel/Session") + if session_server: + message = "load_module/"+name + if syncCall: + session_server.emitMessage(message) + else: + session_server.emitMessageOneWay(message) + except: + pass \ No newline at end of file -- 2.39.2