diff options
| author | Christian Tismer <tismer@stackless.com> | 2022-05-19 18:41:05 +0200 |
|---|---|---|
| committer | Christian Tismer <tismer@stackless.com> | 2022-05-27 16:49:08 +0200 |
| commit | bcd1ac22f8e4e804b4082e311d4a8c43f3f3d4d6 (patch) | |
| tree | 683060fe8f4a0922411d741879b8d151c526140c /sources/pyside6/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py | |
| parent | 3bd132cbaf01fe1e929e1279d5b32b3c412cdcf4 (diff) | |
Limited_API: Fix PyIndex_Check once and for all
PyIndex_Check was left as a macro for Python <= 3.7 . This was
fixed for Python 3.8 (I failed to submit the patch in time :( )
The problem is a bit weird, because we cannot do a compile time
decision which Python version it is, because exactly that is
only known at runtime. Therefore:
- we cannot use a builtin version of PyIndex_Check, because
this would create a link error with Python < 3.8
- PyType_GetSlot would help with this, but unfortunately this
worked only with heap types, and the use case is on normal
integers.
The solution is quite ok:
-------------------------
The structure of the type objects from Python 3.6 on is compatible
enough for the field offset that we need here, so on old Python
versions, the old type structure can be used.
From Python 3.10 on, PyType_GetSlot is extended to non-heap types,
and we can simply use that.
This patch can be removed completely when we drop Python 3.7 .
An automated warning that suggests this removal was added.
[ChangeLog][shiboken6] The handling of a complex Limited API bug
was fixed for different combinations of PySide/Python versions.
Change-Id: I945aa5ae1ea5cd9de7c6e140c32a1e9467735a8e
Fixes: PYSIDE-1797
Pick-to: 6.2 6.3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py')
0 files changed, 0 insertions, 0 deletions
