aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/pep384impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/libshiboken/pep384impl.h')
-rw-r--r--sources/shiboken2/libshiboken/pep384impl.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/pep384impl.h b/sources/shiboken2/libshiboken/pep384impl.h
index ffbc570a8..93f718988 100644
--- a/sources/shiboken2/libshiboken/pep384impl.h
+++ b/sources/shiboken2/libshiboken/pep384impl.h
@@ -201,7 +201,12 @@ LIBSHIBOKEN_API int Pep_GetVerboseFlag(void);
LIBSHIBOKEN_API char *_PepUnicode_AsString(PyObject *);
+#if PY_VERSION_HEX < 0x03000000
#define PyUnicode_GET_SIZE(op) PyUnicode_GetSize((PyObject *)(op))
+#else
+// PyUnicode_GetSize is deprecated in favor of PyUnicode_GetLength
+#define PyUnicode_GET_SIZE(op) PyUnicode_GetLength((PyObject *)(op))
+#endif
#else
#define _PepUnicode_AsString PyUnicode_AsUTF8