]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Salome container initialization for embedded python.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Mon, 16 Jan 2023 11:48:31 +0000 (12:48 +0100)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Mon, 16 Jan 2023 11:48:31 +0000 (12:48 +0100)
src/Container/SALOME_Container.py

index b42536b8a45a9a63fbe723e84b4a8234797d23cc..97bd43e66aa02a715777c8603ce2cffaa5d07c6c 100644 (file)
@@ -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)
 
     #-------------------------------------------------------------------------