From 59d2aafe56991c59a688e9abe70f3e53e4167afe Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Mon, 16 Jan 2023 12:48:31 +0100 Subject: [PATCH] Salome container initialization for embedded python. --- src/Container/SALOME_Container.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Container/SALOME_Container.py b/src/Container/SALOME_Container.py index b42536b8a..97bd43e66 100644 --- a/src/Container/SALOME_Container.py +++ b/src/Container/SALOME_Container.py @@ -60,11 +60,17 @@ class SALOME_Container_i: def __init__(self ,containerName, containerIORStr): MESSAGE( "SALOME_Container_i::__init__" ) - self._orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID) + try: + argv = sys.argv + except AttributeError : + # for embedded python interpreter + # shouldn't be needed after python 3.8 + # see https://bugs.python.org/issue32573 + argv = [''] + self._orb = CORBA.ORB_init(argv, CORBA.ORB_ID) self._poa = self._orb.resolve_initial_references("RootPOA") self._containerName = containerName if verbose(): print("SALOME_Container.SALOME_Container_i : _containerName ",self._containerName) - #self._naming_service = SALOME_NamingServicePy_i(self._orb) self._container = self._orb.string_to_object(containerIORStr) #------------------------------------------------------------------------- -- 2.39.2