From: Ovidiu Mircescu Date: Mon, 23 Aug 2021 15:13:30 +0000 (+0200) Subject: Fix for salome_init called from embedded python. X-Git-Tag: V9_8_0a1~16^2^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fomu%2Flauncher_ssl;p=modules%2Fkernel.git Fix for salome_init called from embedded python. --- diff --git a/src/KERNEL_PY/__init__.py b/src/KERNEL_PY/__init__.py index d0d611d8e..0f7bee48c 100644 --- a/src/KERNEL_PY/__init__.py +++ b/src/KERNEL_PY/__init__.py @@ -239,7 +239,11 @@ def salome_init_without_session(): # activate poaManager to accept co-localized CORBA calls. from KernelSDS import GetDSMInstance import sys - dsm = GetDSMInstance(sys.argv) + if hasattr(sys, 'argv'): + argv = sys.argv + else: + argv = [''] + dsm = GetDSMInstance(argv) # esm inherits from SALOME_CPythonHelper singleton already initialized by GetDSMInstance # esm inherits also from SALOME_ResourcesManager creation/initialization (concerning SingleThreadPOA POA) when KernelLauncher.GetContainerManager() has been called esm = KernelLauncher.GetExternalServer()