aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/pysideproperty.cpp
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <cristian.maureira-fredes@qt.io>2024-11-06 11:10:03 +0100
committerCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2024-11-08 14:24:28 +0100
commit65a9ae9a853fa68ff997edbe3d6fd4eed022f1a0 (patch)
tree735b82851430560a81ec28a848cdd09fdb2c36c0 /sources/pyside6/libpyside/pysideproperty.cpp
parentc951f11196d0572b7250a74197937c02b74604dd (diff)
limited api: Remove PyTuple_GET_ITEM, PyTuple_SET_ITEM, and PyTuple_GET_SIZE macros
Removing old macros for compatibility with the limited api, and refactoring some of their usages Change-Id: I33954199d2ef9884c64b963863b97aed851c440f Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/libpyside/pysideproperty.cpp')
-rw-r--r--sources/pyside6/libpyside/pysideproperty.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/sources/pyside6/libpyside/pysideproperty.cpp b/sources/pyside6/libpyside/pysideproperty.cpp
index bbc289231..7c0400051 100644
--- a/sources/pyside6/libpyside/pysideproperty.cpp
+++ b/sources/pyside6/libpyside/pysideproperty.cpp
@@ -99,7 +99,7 @@ PyObject *PySidePropertyPrivate::getValue(PyObject *source) const
if (fget) {
Shiboken::AutoDecRef args(PyTuple_New(1));
Py_INCREF(source);
- PyTuple_SET_ITEM(args, 0, source);
+ PyTuple_SetItem(args, 0, source);
return PyObject_CallObject(fget, args);
}
return nullptr;
@@ -109,8 +109,8 @@ int PySidePropertyPrivate::setValue(PyObject *source, PyObject *value)
{
if (fset && value) {
Shiboken::AutoDecRef args(PyTuple_New(2));
- PyTuple_SET_ITEM(args, 0, source);
- PyTuple_SET_ITEM(args, 1, value);
+ PyTuple_SetItem(args, 0, source);
+ PyTuple_SetItem(args, 1, value);
Py_INCREF(source);
Py_INCREF(value);
Shiboken::AutoDecRef result(PyObject_CallObject(fset, args));
@@ -118,7 +118,7 @@ int PySidePropertyPrivate::setValue(PyObject *source, PyObject *value)
}
if (fdel) {
Shiboken::AutoDecRef args(PyTuple_New(1));
- PyTuple_SET_ITEM(args, 0, source);
+ PyTuple_SetItem(args, 0, source);
Py_INCREF(source);
Shiboken::AutoDecRef result(PyObject_CallObject(fdel, args));
return (result.isNull() ? -1 : 0);
@@ -132,7 +132,7 @@ int PySidePropertyPrivate::reset(PyObject *source)
if (freset) {
Shiboken::AutoDecRef args(PyTuple_New(1));
Py_INCREF(source);
- PyTuple_SET_ITEM(args, 0, source);
+ PyTuple_SetItem(args, 0, source);
Shiboken::AutoDecRef result(PyObject_CallObject(freset, args));
return (result.isNull() ? -1 : 0);
}
@@ -456,9 +456,9 @@ static PyObject *getFromType(PyTypeObject *type, PyObject *name)
auto *attr = PyDict_GetItem(tpDict.object(), name);
if (!attr) {
PyObject *bases = type->tp_bases;
- const Py_ssize_t size = PyTuple_GET_SIZE(bases);
+ const Py_ssize_t size = PyTuple_Size(bases);
for (Py_ssize_t i = 0; i < size; ++i) {
- PyObject *base = PyTuple_GET_ITEM(bases, i);
+ PyObject *base = PyTuple_GetItem(bases, i);
attr = getFromType(reinterpret_cast<PyTypeObject *>(base), name);
if (attr)
return attr;