Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2023-10-08 18:20:39 +0200
committerChristian Tismer <tismer@stackless.com>2023-10-09 11:32:10 +0200
commit8b9d69fac87cb18777e33103512c8592edd05ff4 (patch)
treeb862eb3fc03a5d4a4fe87087eeff839c8ad83803 /sources/pyside6/libpyside/dynamicqmetaobject.cpp
parent65ac5d41a68dac51f85976e22ad2379d659f2f8e (diff)
shiboken: Get rid of tp_dict in general
It is a long due task to finally remove the direct access to type object fields. With Python 3.12, direct access to tp_dict became problematic. We use that as a reason to start removing the direct access in favor of function calls. Task-number: PYSIDE-2230 Change-Id: I6f8a7479ab0afdbef14d4661f66c3588f3a578aa Pick-to: 6.2 6.5 6.6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/libpyside/dynamicqmetaobject.cpp')
-rw-r--r--sources/pyside6/libpyside/dynamicqmetaobject.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/pyside6/libpyside/dynamicqmetaobject.cpp b/sources/pyside6/libpyside/dynamicqmetaobject.cpp
index 691e66ddc..b7fbc7661 100644
--- a/sources/pyside6/libpyside/dynamicqmetaobject.cpp
+++ b/sources/pyside6/libpyside/dynamicqmetaobject.cpp
@@ -585,7 +585,8 @@ void MetaObjectBuilderPrivate::parsePythonType(PyTypeObject *type)
// Leave the properties to be registered after signals because they may depend on
// notify signals.
for (PyTypeObject *baseType : basesToCheck) {
- PyObject *attrs = baseType->tp_dict;
+ AutoDecRef tpDict(PepType_GetDict(baseType));
+ PyObject *attrs = tpDict.object();
PyObject *key = nullptr;
PyObject *value = nullptr;
Py_ssize_t pos = 0;
@@ -617,7 +618,8 @@ void MetaObjectBuilderPrivate::parsePythonType(PyTypeObject *type)
// Signals and slots should be separated, unless the types are modified, later.
// We check for this using "is_sorted()". Sorting no longer happens at all.
for (PyTypeObject *baseType : basesToCheck) {
- PyObject *attrs = baseType->tp_dict;
+ AutoDecRef tpDict(PepType_GetDict(baseType));
+ PyObject *attrs = tpDict.object();
PyObject *key = nullptr;
PyObject *value = nullptr;
Py_ssize_t pos = 0;