From d77a90d4ef30d311dea39a7f4c3399e4363cc1b7 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Sat, 28 Mar 2020 18:59:00 +0100 Subject: 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 --- sources/pyside2/PySide2/glue/qtcore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sources/pyside2/PySide2/glue/qtcore.cpp') 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); -- cgit v1.2.3