From: Ovidiu Mircescu Date: Mon, 16 Jan 2023 11:48:31 +0000 (+0100) Subject: Salome container initialization for embedded python. X-Git-Tag: V9_11_0a1~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=59d2aafe56991c59a688e9abe70f3e53e4167afe;p=modules%2Fkernel.git Salome container initialization for embedded python. --- 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) #-------------------------------------------------------------------------