aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/globalreceiverv2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/libpyside/globalreceiverv2.cpp')
-rw-r--r--sources/pyside6/libpyside/globalreceiverv2.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/sources/pyside6/libpyside/globalreceiverv2.cpp b/sources/pyside6/libpyside/globalreceiverv2.cpp
index 0fe67db37..909c2bde6 100644
--- a/sources/pyside6/libpyside/globalreceiverv2.cpp
+++ b/sources/pyside6/libpyside/globalreceiverv2.cpp
@@ -39,6 +39,7 @@
#include "globalreceiverv2.h"
#include "dynamicqmetaobject_p.h"
+#include "pyside_p.h"
#include "pysideweakref.h"
#include "pysidestaticstrings.h"
#include "signalmanager.h"
@@ -115,8 +116,7 @@ DynamicSlotDataV2::DynamicSlotDataV2(PyObject *callback, GlobalReceiverV2 *paren
//monitor class from method lifetime
m_weakRef = WeakRef::create(m_pythonSelf, DynamicSlotDataV2::onCallbackDestroyed, this);
- } else if (PyObject_HasAttr(callback, PySide::PyName::im_func())
- && PyObject_HasAttr(callback, PySide::PyName::im_self())) {
+ } else if (PySide::_isCompiledMethod(callback)) {
// PYSIDE-1523: PyMethod_Check is not accepting compiled form, we just go by attributes.
m_isMethod = true;
@@ -142,8 +142,7 @@ GlobalReceiverKey DynamicSlotDataV2::key(PyObject *callback)
if (PyMethod_Check(callback)) {
// PYSIDE-1422: Avoid hash on self which might be unhashable.
return {PyMethod_GET_SELF(callback), PyMethod_GET_FUNCTION(callback)};
- } else if (PyObject_HasAttr(callback, PySide::PyName::im_func())
- && PyObject_HasAttr(callback, PySide::PyName::im_self())) {
+ } else if (PySide::_isCompiledMethod(callback)) {
// PYSIDE-1589: Fix for slots in compiled functions
Shiboken::AutoDecRef self(PyObject_GetAttr(callback, PySide::PyName::im_self()));
Shiboken::AutoDecRef func(PyObject_GetAttr(callback, PySide::PyName::im_func()));