aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/QtCore/glue
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2017-12-17 19:12:56 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-05-30 18:13:41 +0000
commit18dc31becdd994c53a9f894087cf1ef99fbd0232 (patch)
tree3021cfa473f20102bfb63a26117776615b91b526 /sources/pyside2/PySide2/QtCore/glue
parent50dd4ae202d7afb3556335c056db003f5ef50532 (diff)
PEP 384-squash: Implement PEP 384
This is the condensed checkin of 18 commits which created the implementation of PEP 384. Task-number: PYSIDE-560 Change-Id: I834c659af4c2b55b268f8e8dc4cfa53f02502409 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/pyside2/PySide2/QtCore/glue')
-rw-r--r--sources/pyside2/PySide2/QtCore/glue/qbytearray_bufferprotocol.cpp2
-rw-r--r--sources/pyside2/PySide2/QtCore/glue/qbytearray_mgetitem.cpp2
-rw-r--r--sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.cpp2
-rw-r--r--sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.h2
-rw-r--r--sources/pyside2/PySide2/QtCore/glue/qobject_connect.cpp3
-rw-r--r--sources/pyside2/PySide2/QtCore/glue/qobject_findchild.cpp4
6 files changed, 7 insertions, 8 deletions
diff --git a/sources/pyside2/PySide2/QtCore/glue/qbytearray_bufferprotocol.cpp b/sources/pyside2/PySide2/QtCore/glue/qbytearray_bufferprotocol.cpp
index 22825a5cb..ed5fef3ae 100644
--- a/sources/pyside2/PySide2/QtCore/glue/qbytearray_bufferprotocol.cpp
+++ b/sources/pyside2/PySide2/QtCore/glue/qbytearray_bufferprotocol.cpp
@@ -47,7 +47,7 @@ extern "C" {
static Py_ssize_t SbkQByteArray_segcountproc(PyObject* self, Py_ssize_t* lenp)
{
if (lenp)
- *lenp = self->ob_type->tp_as_sequence->sq_length(self);
+ *lenp = Py_TYPE(self)->tp_as_sequence->sq_length(self);
return 1;
}
diff --git a/sources/pyside2/PySide2/QtCore/glue/qbytearray_mgetitem.cpp b/sources/pyside2/PySide2/QtCore/glue/qbytearray_mgetitem.cpp
index 6a997c852..f1d5a6bfc 100644
--- a/sources/pyside2/PySide2/QtCore/glue/qbytearray_mgetitem.cpp
+++ b/sources/pyside2/PySide2/QtCore/glue/qbytearray_mgetitem.cpp
@@ -82,6 +82,6 @@ if (PyIndex_Check(_key)) {
} else {
PyErr_Format(PyExc_TypeError,
"list indices must be integers or slices, not %.200s",
- _key->ob_type->tp_name);
+ PepType((Py_TYPE(_key)))->tp_name);
return NULL;
}
diff --git a/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.cpp b/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.cpp
index 5d28fbf41..46a69be31 100644
--- a/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.cpp
+++ b/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include <Python.h>
+#include <sbkpython.h>
#include <shiboken.h>
#include <pysideweakref.h>
#include <QEasingCurve>
diff --git a/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.h b/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.h
index 7053d808c..358ea9eec 100644
--- a/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.h
+++ b/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.h
@@ -40,7 +40,7 @@
#ifndef __QEASINGCURVE_GLUE__
#define __QEASINGCURVE_GLUE__
-#include <Python.h>
+#include <sbkpython.h>
#include <QEasingCurve>
class PySideEasingCurveFunctor
diff --git a/sources/pyside2/PySide2/QtCore/glue/qobject_connect.cpp b/sources/pyside2/PySide2/QtCore/glue/qobject_connect.cpp
index ed37cef34..20f3720bf 100644
--- a/sources/pyside2/PySide2/QtCore/glue/qobject_connect.cpp
+++ b/sources/pyside2/PySide2/QtCore/glue/qobject_connect.cpp
@@ -43,8 +43,7 @@ static bool isDecorator(PyObject* method, PyObject* self)
if (!PyObject_HasAttr(self, methodName))
return true;
Shiboken::AutoDecRef otherMethod(PyObject_GetAttr(self, methodName));
- return reinterpret_cast<PyMethodObject*>(otherMethod.object())->im_func != \
- reinterpret_cast<PyMethodObject*>(method)->im_func;
+ return PyMethod_GET_FUNCTION(otherMethod.object()) != PyMethod_GET_FUNCTION(method);
}
static bool getReceiver(QObject *source, const char* signal, PyObject* callback, QObject** receiver, PyObject** self, QByteArray* callbackSig)
diff --git a/sources/pyside2/PySide2/QtCore/glue/qobject_findchild.cpp b/sources/pyside2/PySide2/QtCore/glue/qobject_findchild.cpp
index 464fb68b1..b32d104fd 100644
--- a/sources/pyside2/PySide2/QtCore/glue/qobject_findchild.cpp
+++ b/sources/pyside2/PySide2/QtCore/glue/qobject_findchild.cpp
@@ -41,7 +41,7 @@ static QObject* _findChildHelper(const QObject* parent, const QString& name, PyT
{
foreach(QObject* child, parent->children()) {
Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QObject*](child));
- if (PyType_IsSubtype(pyChild->ob_type, desiredType)
+ if (PyType_IsSubtype(Py_TYPE(pyChild), desiredType)
&& (name.isNull() || name == child->objectName())) {
return child;
}
@@ -71,7 +71,7 @@ static void _findChildrenHelper(const QObject* parent, const T& name, PyTypeObje
{
foreach(const QObject* child, parent->children()) {
Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QObject*](child));
- if (PyType_IsSubtype(pyChild->ob_type, desiredType) && _findChildrenComparator(child, name))
+ if (PyType_IsSubtype(Py_TYPE(pyChild), desiredType) && _findChildrenComparator(child, name))
PyList_Append(result, pyChild);
_findChildrenHelper(child, name, desiredType, result);
}