see https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads
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
void SALOME_CPythonHelper::initializePython(int argc, char *argv[])
{
Py_Initialize();
+#if PY_VERSION_HEX < 0x03070000
PyEval_InitThreads();
+#endif
wchar_t **changed_argv = new wchar_t*[argc]; // Setting arguments
for (int i = 0; i < argc; i++)
changed_argv[i] = Py_DecodeLocale(argv[i], NULL);