Fix misuse of PyUnicode_GET_SIZE() => PyUnicode_GET_LENGTH()

And PyUnicode_GetSize() => PyUnicode_GetLength()
This commit is contained in:
Victor Stinner 2011-11-21 02:49:52 +01:00
parent f3ae6208c7
commit 9e30aa52fd
10 changed files with 18 additions and 19 deletions

View file

@ -4784,7 +4784,7 @@ _PyUnicode_AsUTF8String(PyObject *unicode, const char *errors)
if (PyBytes_Check(rep))
repsize = PyBytes_GET_SIZE(rep);
else
repsize = PyUnicode_GET_SIZE(rep);
repsize = PyUnicode_GET_LENGTH(rep);
if (repsize > 4) {
Py_ssize_t offset;
@ -8187,7 +8187,7 @@ charmap_encoding_error(
Py_DECREF(repunicode);
return -1;
}
repsize = PyUnicode_GET_SIZE(repunicode);
repsize = PyUnicode_GET_LENGTH(repunicode);
data = PyUnicode_DATA(repunicode);
kind = PyUnicode_KIND(repunicode);
for (index = 0; index < repsize; index++) {