Replace use of deprecated PyUnicode APIs

This commit is contained in:
Scott Talbert
2023-05-19 13:59:33 -04:00
parent 33cabe97b7
commit 2631eecb60
3 changed files with 4 additions and 4 deletions

View File

@@ -59,7 +59,7 @@
}
PyErr_Clear();
wxString string;
size_t len = PyUnicode_GET_SIZE(item);
size_t len = PyUnicode_GET_LENGTH(item);
if (len) {
wxPyUnicode_AsWideChar(item, wxStringBuffer(string, len), len);
}

View File

@@ -45,7 +45,7 @@
}
}
*sipCppPtr = new wxString();
size_t len = PyUnicode_GET_SIZE(uni);
size_t len = PyUnicode_GET_LENGTH(uni);
if (len) {
wxPyUnicode_AsWideChar(uni, wxStringBuffer(**sipCppPtr, len), len);
}

View File

@@ -54,7 +54,7 @@ static wxString i_Py2wxString(PyObject* source)
}
}
wxString target;
size_t len = PyUnicode_GET_SIZE(uni);
size_t len = PyUnicode_GET_LENGTH(uni);
if (len) {
wxPyUnicode_AsWideChar(uni, wxStringBuffer(target, len), len);
}
@@ -84,7 +84,7 @@ static wxString i_Py2wxString(PyObject* source)
// }
// }
// // TODO: Coerce non-unicode types to unicode here? (Classic does)
// size_t len = PyUnicode_GET_SIZE(uni);
// size_t len = PyUnicode_GET_LENGTH(uni);
// if (len) {
// wxPyUnicode_AsWideChar(uni, wxStringBuffer(str, len), len);
// }