aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/sbkpython.h
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2020-03-28 18:59:00 +0100
committerChristian Tismer <tismer@stackless.com>2020-03-30 17:58:29 +0200
commitd77a90d4ef30d311dea39a7f4c3399e4363cc1b7 (patch)
treece595f825b9a7533935618022dcc3dde12b06ef0 /sources/shiboken2/libshiboken/sbkpython.h
parentb28ce21f046ba3e87b12208621c3d9ae6a295944 (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/shiboken2/libshiboken/sbkpython.h')
-rw-r--r--sources/shiboken2/libshiboken/sbkpython.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/sbkpython.h b/sources/shiboken2/libshiboken/sbkpython.h
index f06b0b19e..9dd1e712e 100644
--- a/sources/shiboken2/libshiboken/sbkpython.h
+++ b/sources/shiboken2/libshiboken/sbkpython.h
@@ -72,6 +72,7 @@ extern "C" {
// Now we have the usual variables from Python.h .
# include "python25compat.h"
# include "shibokenmacros.h"
+// "pep384impl.h" may nowhere be included but in this file.
# include "pep384impl.h"
# include "typespec.h"
# pragma pop_macro("slots")
@@ -98,6 +99,7 @@ extern "C" {
// Now we have the usual variables from Python.h .
# include "python25compat.h"
# include "shibokenmacros.h"
+// "pep384impl.h" may nowhere be included but in this file.
# include "pep384impl.h"
# include "typespec.h"
#endif