From 75012a80440f2302d3dc0e57ea264b9c26c26789 Mon Sep 17 00:00:00 2001 From: Tatyana Krasnukha Date: Tue, 4 Aug 2020 20:52:48 +0300 Subject: [lldb] Use PyUnicode_GetLength instead of PyUnicode_GetSize PyUnicode_GetSize is deprecated since Python version 3.3. --- lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp index 6f040fd..7c49502 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -451,7 +451,11 @@ Expected PythonString::AsUTF8() const { size_t PythonString::GetSize() const { if (IsValid()) { #if PY_MAJOR_VERSION >= 3 +#if PY_MINOR_VERSION >= 3 + return PyUnicode_GetLength(m_py_obj); +#else return PyUnicode_GetSize(m_py_obj); +#endif #else return PyString_Size(m_py_obj); #endif -- cgit v1.1