X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FContainer%2FContainer_init_python.cxx;h=26a40b4550cea08b4810c91bb9d237d28202277b;hb=3ce0546302001755828c8476425a60c6ab61ac92;hp=744474d4db3a82c73f987725e8c26d4c830f0b39;hpb=77773aa5efd0d400ad59025b9c4ec050d593c0dd;p=modules%2Fkernel.git diff --git a/src/Container/Container_init_python.cxx b/src/Container/Container_init_python.cxx index 744474d4d..26a40b455 100644 --- a/src/Container/Container_init_python.cxx +++ b/src/Container/Container_init_python.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -165,9 +165,6 @@ void KERNEL_PYTHON::init_python(int argc, char **argv) MESSAGE("Python already initialized"); return; } - MESSAGE("================================================================="); - MESSAGE("Python Initialization..."); - MESSAGE("================================================================="); // set stdout to line buffering (aka C++ std::cout) setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ); char* env_python=getenv("SALOME_PYTHON"); @@ -179,7 +176,7 @@ void KERNEL_PYTHON::init_python(int argc, char **argv) Py_Initialize(); // Initialize the interpreter if (Py_IsInitialized()) { - MESSAGE("Python initialized eh eh eh"); + MESSAGE("Python initialized"); } wchar_t **changed_argv = new wchar_t*[argc]; // Setting arguments for (int i = 0; i < argc; i++) @@ -202,8 +199,9 @@ void KERNEL_PYTHON::init_python(int argc, char **argv) script += "del _custom_except_hook, sys\n"; PyRun_SimpleString(script.c_str()); // VSR (22/09/2016): end of workaround +#if PY_VERSION_HEX < 0x03070000 PyEval_InitThreads(); // Create (and acquire) the interpreter lock - +#endif // Create python objects to capture stdout and stderr PyObject* _vout=(PyObject*)ContainerNewPyStdOut( false ); // stdout PyObject* _verr=(PyObject*)ContainerNewPyStdOut( true ); // stderr