From b303b4d53f2e11476c35e188d353538479945989 Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Mon, 23 Aug 2021 17:13:30 +0200 Subject: [PATCH] Fix for salome_init called from embedded python. --- src/KERNEL_PY/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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() -- 2.39.2