diff options
author | Christian Tismer <tismer@stackless.com> | 2020-03-28 18:59:00 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2020-03-30 17:58:29 +0200 |
commit | d77a90d4ef30d311dea39a7f4c3399e4363cc1b7 (patch) | |
tree | ce595f825b9a7533935618022dcc3dde12b06ef0 /sources/pyside2/PySide2/glue/qtcore.cpp | |
parent | b28ce21f046ba3e87b12208621c3d9ae6a295944 (diff) |
shiboken: Update sbkstring to use PyUnicode_GetLength
The unicode implementation has changed very much.
PyUnicode_GET_SIZE has been used all the time, although this
macro is already a quite expensive real function since Python 3.3 .
The function is deprecated, and the macro PyUnicode_GET_LENGTH
should be used, instead.
This is relevant for cleaning things up, because in the course of
fixing PYSIDE-813 we work with debug Python, which then complains
that Python memory is used without holding the GIL.
The usage of the right implementation was ensured by a function
PepUnicode_GetLength and removing all traces of the former version.
Task-number: PYSIDE-813
Change-Id: I62e94e10e14975dac3dad0ed1fffec8a1b54a0d5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside2/PySide2/glue/qtcore.cpp')
-rw-r--r-- | sources/pyside2/PySide2/glue/qtcore.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp index 60ddf675c..169b89cae 100644 --- a/sources/pyside2/PySide2/glue/qtcore.cpp +++ b/sources/pyside2/PySide2/glue/qtcore.cpp @@ -1685,7 +1685,7 @@ Py_UNICODE *unicode = PyUnicode_AS_UNICODE(%in); // cast as Py_UNICODE can be a different type %out = QString::fromUcs4((const uint *)unicode); # else -%out = QString::fromUtf16((const ushort *)unicode, PyUnicode_GET_SIZE(%in)); +%out = QString::fromUtf16((const ushort *)unicode, PepUnicode_GetLength(%in)); # endif #else wchar_t *temp = PyUnicode_AsWideCharString(%in, NULL); |