aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/class_property.cpp
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-09-11 15:51:02 +0200
committerChristian Tismer <tismer@stackless.com>2021-09-15 15:57:07 +0200
commitd0678ae7cac8f80a5b80042edb13335f438bb9ce (patch)
tree007f401ccdfc2075a9b9aef8e83829b469b46e94 /sources/pyside6/libpyside/class_property.cpp
parent203e8961ecd8b94211845f4f6519788e34dd3230 (diff)
PyPySide: Encapsulate type generation to be PyPy compatible
Type generation in PyPy is critical. When type creation calls PyType_Ready, PyPy freezes the current state of the type object. That has fatal effects, because with the Limited API, we need to patch some types a little _after_ creation. The functionality of this patch is still the same, but type creation is totally encapsulated, and we can do a different implementation for PyPy. [ChangeLog][PySide6] PyPySide: Type creation was completely encapsulated. The implementation can now be rewritten for PyPy. Task-number: PYSIDE-535 Change-Id: Iae0cadb15b631344ae76cea8c104d4b69941c2b0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/libpyside/class_property.cpp')
-rw-r--r--sources/pyside6/libpyside/class_property.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/sources/pyside6/libpyside/class_property.cpp b/sources/pyside6/libpyside/class_property.cpp
index 63850be07..74ee79e4d 100644
--- a/sources/pyside6/libpyside/class_property.cpp
+++ b/sources/pyside6/libpyside/class_property.cpp
@@ -92,7 +92,7 @@ static PyType_Slot PyClassProperty_slots[] = {
};
static PyType_Spec PyClassProperty_spec = {
- "PySide6.QtCore.PyClassProperty",
+ "2:PySide6.QtCore.PyClassProperty",
sizeof(propertyobject),
0,
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
@@ -105,8 +105,7 @@ PyTypeObject *PyClassPropertyTypeF()
if (type == nullptr) {
// Provide the same `tp_getset`, which is not inherited.
PyClassProperty_slots[0].pfunc = PyProperty_Type.tp_getset;
- type = reinterpret_cast<PyTypeObject *>(
- PyType_FromSpec(&PyClassProperty_spec));
+ type = SbkType_FromSpec(&PyClassProperty_spec);
}
return type;
}