aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/libshiboken/basewrapper.cpp
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/shiboken6/libshiboken/basewrapper.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/shiboken6/libshiboken/basewrapper.cpp')
-rw-r--r--sources/shiboken6/libshiboken/basewrapper.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/sources/shiboken6/libshiboken/basewrapper.cpp b/sources/shiboken6/libshiboken/basewrapper.cpp
index 66104123f..adeaf6487 100644
--- a/sources/shiboken6/libshiboken/basewrapper.cpp
+++ b/sources/shiboken6/libshiboken/basewrapper.cpp
@@ -111,7 +111,8 @@ type_set_doc(PyTypeObject *type, PyObject *value, void * /* context */)
if (!check_set_special_type_attr(type, value, "__doc__"))
return -1;
PyType_Modified(type);
- return PyDict_SetItem(type->tp_dict, Shiboken::PyMagicName::doc(), value);
+ Shiboken::AutoDecRef tpDict(PepType_GetDict(type));
+ return PyDict_SetItem(tpDict.object(), Shiboken::PyMagicName::doc(), value);
}
// PYSIDE-908: The function PyType_Modified does not work in PySide, so we need to