Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2024-05-09 22:43:59 +0200
committerChristian Tismer <tismer@stackless.com>2024-06-07 16:03:38 +0200
commit22c9f7bf46d8c3d9be8ab348e4217790a69033cc (patch)
tree026f8bdba1aca0bc2af7e28a88b647fa7b91eecb /sources/pyside6/libpyside/pysidesignal.cpp
parentbb01f6b30606699b6066bb7ae94f4d59929172e4 (diff)
shiboken: Fix a warning crash that is present in Python 3.13
This problem is new shown in Python 3.13 although this was not correct before. We need to remove the error before issuing a warning. Task-number: PYSIDE-2751 Change-Id: Ie4572e043388ca3f87092ea886e935b583f871b4 Pick-to: 6.7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/libpyside/pysidesignal.cpp')
-rw-r--r--sources/pyside6/libpyside/pysidesignal.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/sources/pyside6/libpyside/pysidesignal.cpp b/sources/pyside6/libpyside/pysidesignal.cpp
index 35a6e7ef9..ed0cc5d0a 100644
--- a/sources/pyside6/libpyside/pysidesignal.cpp
+++ b/sources/pyside6/libpyside/pysidesignal.cpp
@@ -653,8 +653,11 @@ static PyObject *signalInstanceGetItem(PyObject *self, PyObject *key)
static inline void warnDisconnectFailed(PyObject *aSlot, const QByteArray &signature)
{
if (PyErr_Occurred() != nullptr) { // avoid "%S" invoking str() when an error is set.
+ PyObject *exc{}, *inst{}, *tb{};
+ PyErr_Fetch(&exc, &inst, &tb);
PyErr_WarnFormat(PyExc_RuntimeWarning, 0, "Failed to disconnect (%s) from signal \"%s\".",
Py_TYPE(aSlot)->tp_name, signature.constData());
+ PyErr_Restore(exc, inst, tb);
} else {
PyErr_WarnFormat(PyExc_RuntimeWarning, 0, "Failed to disconnect (%S) from signal \"%s\".",
aSlot, signature.constData());