From 3e85bb8ce8169d52354de5a6102c352354481736 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Wed, 4 Jan 2023 10:41:57 +0100 Subject: [PATCH] bos #33259: patch PyQt 5.15.3 to fix shell error message when exiting Paraview --- products/PyQt.pyconf | 1 + ...yqt-5.15.3-qpycore-init-pyqtparaview.patch | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 products/patches/pyqt-5.15.3-qpycore-init-pyqtparaview.patch diff --git a/products/PyQt.pyconf b/products/PyQt.pyconf index 3d91707..e67bb9a 100644 --- a/products/PyQt.pyconf +++ b/products/PyQt.pyconf @@ -41,6 +41,7 @@ version_5_15_7_win : version_5_15_3 : { compil_script : "PyQt-5.15" + $VARS.scriptExtension + patches : ['pyqt-5.15.3-qpycore-init-pyqtparaview.patch'] # see bos #33259 } version_5_15_3_win : diff --git a/products/patches/pyqt-5.15.3-qpycore-init-pyqtparaview.patch b/products/patches/pyqt-5.15.3-qpycore-init-pyqtparaview.patch new file mode 100644 index 0000000..aa097be --- /dev/null +++ b/products/patches/pyqt-5.15.3-qpycore-init-pyqtparaview.patch @@ -0,0 +1,28 @@ +diff -Naur PyQt5-5.15.3_init/qpy/QtCore/qpycore_init.cpp PyQt5-5.15.3/qpy/QtCore/qpycore_init.cpp +--- PyQt5-5.15.3_init/qpy/QtCore/qpycore_init.cpp 2022-11-17 13:26:26.311645609 +0100 ++++ PyQt5-5.15.3/qpy/QtCore/qpycore_init.cpp 2022-11-17 13:36:32.687598350 +0100 +@@ -28,6 +28,8 @@ + #include "sipAPIQtCore.h" + + #include ++#include ++#include + + + // Set if any QCoreApplication (or sub-class) instance was created from Python. +@@ -45,11 +47,13 @@ + if (qpycore_created_qapp) + { + QCoreApplication *app = QCoreApplication::instance(); +- ++ QProcessEnvironment pe(QProcessEnvironment::systemEnvironment()); ++ QString pyqt5_not_master("PYQT5_NOT_MASTER"); + if (app) + { + Py_BEGIN_ALLOW_THREADS +- delete app; ++ if( !pe.contains(pyqt5_not_master) || pe.value(pyqt5_not_master).isEmpty() ) ++ delete app; + Py_END_ALLOW_THREADS + } + } -- 2.39.2