1From: Christian Tismer <tismer@stackless.com>
2Date: Tue, 14 Feb 2023 14:46:22 +0100
3Subject: Python 3.12: Fix the structure of class property
4
5There is a PySide bug in Python 3.10 already: The structure for
6classproperty derives from the property structure. This was extended
7in Python 3.10, already, but the type generation check was made more
8exhaustive in Python 3.12 and recognized that.
9
10This change is only for making the compiler/C API happy.
11In order to use the extension field, it is necessary to do a runtime
12check because of the Limited API.
13
14Task-number: PYSIDE-2230
15Change-Id: I88dcaa11589ff41852f08fa2defa5200a0dd4eb6
16Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
17Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
18(cherry picked from commit edfd9a5ad174a48f8d7da511dc6a1c69e931a418)
19---
20 sources/pyside2/libpyside/feature_select.cpp | 5 +++++
21 1 file changed, 5 insertions(+)
22
23diff --git a/sources/pyside2/libpyside/feature_select.cpp b/sources/pyside2/libpyside/feature_select.cpp
24index 3011b35..b9e1470 100644
25--- a/sources/pyside2/libpyside/feature_select.cpp
26+++ b/sources/pyside2/libpyside/feature_select.cpp
27@@ -671,6 +671,11 @@ typedef struct {
28 PyObject *prop_set;
29 PyObject *prop_del;
30 PyObject *prop_doc;
31+#if PY_VERSION_HEX >= 0x030A0000
32+ // Note: This is a problem with Limited API: We have no direct access.
33+ // You need to pick it from runtime info.
34+ PyObject *prop_name;
35+#endif
36 int getter_doc;
37 } propertyobject;