Salome HOME
33059a2d571f8e51ec395812ecd37ac2efa326a2
[tools/configuration.git] / config / patches / paraview.001_against_multiple_py_sv_thr.patch
1 diff -ruN ParaView/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx ParaView_new/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx
2 --- ParaView/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx   2019-05-28 08:19:55.673481437 +0200
3 +++ ParaView_new/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx       2019-05-28 08:08:21.000000000 +0200
4 @@ -260,8 +260,11 @@
5      vtkPythonInterpreter::InitializedOnce = true;
6  
7  #ifdef VTK_PYTHON_FULL_THREADSAFE
8 -    PyEval_InitThreads(); // safe to call this multiple time
9 -    PyEval_SaveThread(); // release GIL
10 +    if(PyEval_ThreadsInitialized() == 0)
11 +    {
12 +      PyEval_InitThreads(); // safe to call this multiple time
13 +      PyEval_SaveThread(); // release GIL
14 +    }
15  #endif
16  
17      // HACK: Calling PyRun_SimpleString for the first time for some reason results in