mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-30 02:31:30 +00:00
[lldb] Use PyUnicode_GetLength instead of PyUnicode_GetSize
PyUnicode_GetSize is deprecated since Python version 3.3.
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user