aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2023-02-14 14:46:22 +0100
committerChristian Tismer <tismer@stackless.com>2023-02-17 15:34:53 +0100
commitedfd9a5ad174a48f8d7da511dc6a1c69e931a418 (patch)
treeef175a4bf7e9fec2f84a03fa7b9eb805c836bbb4
parent7662cb8a8329bfe160a3b885d403ec59764f399f (diff)
Python 3.12: Fix the structure of class property
There is a PySide bug in Python 3.10 already: The structure for classproperty derives from the property structure. This was extended in Python 3.10, already, but the type generation check was made more exhaustive in Python 3.12 and recognized that. This change is only for making the compiler/C API happy. In order to use the extension field, it is necessary to do a runtime check because of the Limited API. Task-number: PYSIDE-2230 Change-Id: I88dcaa11589ff41852f08fa2defa5200a0dd4eb6 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--sources/pyside6/libpyside/class_property.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sources/pyside6/libpyside/class_property.h b/sources/pyside6/libpyside/class_property.h
index 10378294e..3f4a6e9e6 100644
--- a/sources/pyside6/libpyside/class_property.h
+++ b/sources/pyside6/libpyside/class_property.h
@@ -15,7 +15,12 @@ typedef struct {
PyObject *prop_set;
PyObject *prop_del;
PyObject *prop_doc;
- int getter_doc;
+#if PY_VERSION_HEX >= 0x030A0000
+ // Note: This is a problem with Limited API: We have no direct access.
+ // You need to pick it from runtime info.
+ PyObject *prop_name;
+#endif
+ int getter_doc;
} propertyobject;
PYSIDE_API PyTypeObject *PyClassProperty_TypeF();