[lldb] Use PyUnicode_GetLength instead of PyUnicode_GetSize
PyUnicode_GetSize is deprecated since Python version 3.3.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user