]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
bos #33259: patch PyQt 5.15.3 to fix shell error message when exiting Paraview
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 4 Jan 2023 09:41:57 +0000 (10:41 +0100)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 4 Jan 2023 09:41:57 +0000 (10:41 +0100)
products/PyQt.pyconf
products/patches/pyqt-5.15.3-qpycore-init-pyqtparaview.patch [new file with mode: 0644]

index 3d917079536fd4fb8d814ab23e481db78fe5f85b..e67bb9acbb81355b04292e1c6298e0b8341aae16 100644 (file)
@@ -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 (file)
index 0000000..aa097be
--- /dev/null
@@ -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 <QCoreApplication>
++#include <QProcessEnvironment>
++#include <QString>
+ // 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
+         }
+     }