[lldb] Use PyUnicode_GetLength instead of PyUnicode_GetSize

PyUnicode_GetSize is deprecated since Python version 3.3.
This commit is contained in:
Tatyana Krasnukha
2020-08-04 20:52:48 +03:00
parent cc68c122cd
commit 75012a8044

View File

@@ -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