[lldb] Use PyUnicode_GetLength instead of PyUnicode_GetSize

PyUnicode_GetSize is deprecated since Python version 3.3.
This commit is contained in:
Tatyana Krasnukha committed 2020-08-05 11:59:47 +03:00
1 parent cc68c122cd
commit 75012a8044
1 file changed
+4
@@ -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