diff options
author | Tatyana Krasnukha <tatyana@synopsys.com> | 2020-08-04 20:52:48 +0300 |
---|---|---|
committer | Tatyana Krasnukha <tatyana@synopsys.com> | 2020-08-05 11:59:47 +0300 |
commit | 75012a80440f2302d3dc0e57ea264b9c26c26789 (patch) | |
tree | 6e8be4856be70ed3c6f448e1e6cb9d567530241d /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | |
parent | cc68c122cd00f99037b8ff7e645e2b387d56da8b (diff) | |
download | llvm-75012a80440f2302d3dc0e57ea264b9c26c26789.zip llvm-75012a80440f2302d3dc0e57ea264b9c26c26789.tar.gz llvm-75012a80440f2302d3dc0e57ea264b9c26c26789.tar.bz2 |
[lldb] Use PyUnicode_GetLength instead of PyUnicode_GetSize
PyUnicode_GetSize is deprecated since Python version 3.3.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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<llvm::StringRef> 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 |