From a103ba73514468b448e6841ee6ee780be481435d Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Thu, 18 Apr 2024 15:16:54 +0200 Subject: [PATCH] bos #41189 - fix FIELD crash --- products/ParaView.pyconf | 3 +- ...aview-5.11.0.p0011-add_dll_directory.patch | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 products/patches/paraview-5.11.0.p0011-add_dll_directory.patch diff --git a/products/ParaView.pyconf b/products/ParaView.pyconf index e82f594..3ac69ab 100755 --- a/products/ParaView.pyconf +++ b/products/ParaView.pyconf @@ -335,7 +335,8 @@ version_5_11_0_win : 'paraview-5.11.0.p002-FindMPI.patch', 'paraview-5.11.0.p004-vtkUniformHyperTreeGrid.patch', 'paraview-5.11.0.p006-GIL.patch', - 'paraview-5.11.0.p009-openturns-1.21.patch' + 'paraview-5.11.0.p009-openturns-1.21.patch', + 'paraview-5.11.0.p0011-add_dll_directory.patch' ] } diff --git a/products/patches/paraview-5.11.0.p0011-add_dll_directory.patch b/products/patches/paraview-5.11.0.p0011-add_dll_directory.patch new file mode 100644 index 0000000..48ccd3b --- /dev/null +++ b/products/patches/paraview-5.11.0.p0011-add_dll_directory.patch @@ -0,0 +1,36 @@ +--- ParaView-5.11.0_ref/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx 2022-11-18 15:26:55.000000000 +0100 ++++ ParaView-5.11.0_new/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx 2024-04-18 14:25:32.000000000 +0200 +@@ -830,25 +830,6 @@ + // the issue. + if (!vtkdir.empty()) + { +-#if PY_VERSION_HEX >= 0x03080000 +- vtkPythonScopeGilEnsurer gilEnsurer(false, true); +- CloseDLLDirectoryCookie(); +- PyObject* os = PyImport_ImportModule("os"); +- if (os) +- { +- PyObject* add_dll_directory = PyObject_GetAttrString(os, "add_dll_directory"); +- if (add_dll_directory && PyCallable_Check(add_dll_directory)) +- { +- PyObject* newpath = PyUnicode_FromString(vtkdir.c_str()); +- DLLDirectoryCookie = PyObject_CallFunctionObjArgs(add_dll_directory, newpath, nullptr); +- Py_XDECREF(newpath); +- } +- +- Py_XDECREF(add_dll_directory); +- } +- +- Py_XDECREF(os); +-#else + std::string env_path; + if (systools::GetEnv("PATH", env_path)) + { +@@ -859,7 +840,6 @@ + env_path = vtkdir; + } + systools::PutEnv(std::string("PATH=") + env_path); +-#endif + } + #endif + -- 2.39.2