From e039ef9105ae4f661c4774feaf7a995bc6b68ea2 Mon Sep 17 00:00:00 2001 From: Gilles DAVID Date: Thu, 27 Jul 2017 17:23:04 +0200 Subject: [PATCH] Avoid using import CORBA Prefer: "from omniORB import CORBA" --- bin/runConsole.py | 2 +- src/Communication_SWIG/libSALOME_Comm.i | 8 ++++---- src/LifeCycleCORBA_SWIG/TestLifeCycleCORBA.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/runConsole.py b/bin/runConsole.py index fe62b6895..9639291f7 100644 --- a/bin/runConsole.py +++ b/bin/runConsole.py @@ -131,7 +131,7 @@ def __get_running_session(requested_port=None, lastInstanceByDefault=False): return host, port, filename # -import CORBA +from omniORB import CORBA import CosNaming import orbmodule diff --git a/src/Communication_SWIG/libSALOME_Comm.i b/src/Communication_SWIG/libSALOME_Comm.i index 9a3c02114..7681ec35f 100644 --- a/src/Communication_SWIG/libSALOME_Comm.i +++ b/src/Communication_SWIG/libSALOME_Comm.i @@ -36,7 +36,7 @@ { PyObject* pdict = PyDict_New(); PyDict_SetItemString(pdict, "__builtins__", PyEval_GetBuiltins()); - PyRun_String("import CORBA", Py_single_input, pdict, pdict); + PyRun_String("from omniORB import CORBA", Py_single_input, pdict, pdict); PyRun_String("o = CORBA.ORB_init([''], CORBA.ORB_ID);", Py_single_input, pdict, pdict); @@ -66,7 +66,7 @@ { PyObject* pdict = PyDict_New(); PyDict_SetItemString(pdict, "__builtins__", PyEval_GetBuiltins()); - PyRun_String("import CORBA", Py_single_input, pdict, pdict); + PyRun_String("from omniORB import CORBA", Py_single_input, pdict, pdict); PyRun_String("o = CORBA.ORB_init([''], CORBA.ORB_ID);", Py_single_input, pdict, pdict); @@ -96,7 +96,7 @@ { PyObject* pdict = PyDict_New(); PyDict_SetItemString(pdict, "__builtins__", PyEval_GetBuiltins()); - PyRun_String("import CORBA", Py_single_input, pdict, pdict); + PyRun_String("from omniORB import CORBA", Py_single_input, pdict, pdict); PyRun_String("o = CORBA.ORB_init([''], CORBA.ORB_ID);", Py_single_input, pdict, pdict); PyObject* orb = PyDict_GetItemString(pdict, "o"); @@ -114,7 +114,7 @@ { PyObject* pdict = PyDict_New(); PyDict_SetItemString(pdict, "__builtins__", PyEval_GetBuiltins()); - PyRun_String("import CORBA", Py_single_input, pdict, pdict); + PyRun_String("from omniORB import CORBA", Py_single_input, pdict, pdict); PyRun_String("o = CORBA.ORB_init([''], CORBA.ORB_ID);", Py_single_input, pdict, pdict); PyObject* orb = PyDict_GetItemString(pdict, "o"); diff --git a/src/LifeCycleCORBA_SWIG/TestLifeCycleCORBA.py b/src/LifeCycleCORBA_SWIG/TestLifeCycleCORBA.py index 878797b5b..b0800d53d 100644 --- a/src/LifeCycleCORBA_SWIG/TestLifeCycleCORBA.py +++ b/src/LifeCycleCORBA_SWIG/TestLifeCycleCORBA.py @@ -47,7 +47,7 @@ except : print 'lcc.FindOrLoad_Component("FactoryServer","SalomeTestComponent") failed' import sys -import CORBA +from omniORB import CORBA import CosNaming orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID) obj = orb.resolve_initial_references("NameService") -- 2.39.2