Fix misuse of PyUnicode_GET_SIZE() => PyUnicode_GET_LENGTH()
And PyUnicode_GetSize() => PyUnicode_GetLength()
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 7438a70..a89798a 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -2941,7 +2941,7 @@
PyErr_BadInternalCall();
return NULL;
}
- llen = PyUnicode_GetSize(result);
+ llen = PyUnicode_GetLength(result);
if (llen > INT_MAX) {
PyErr_SetString(PyExc_ValueError,
"string too large in _PyBytes_FormatLong");
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index a1b79a8..37b7875 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -1273,7 +1273,7 @@
if (!obj)
return -1;
*start = ((PyUnicodeErrorObject *)exc)->start;
- size = PyUnicode_GET_SIZE(obj);
+ size = PyUnicode_GET_LENGTH(obj);
if (*start<0)
*start = 0; /*XXX check for values <0*/
if (*start>=size)
@@ -1341,7 +1341,7 @@
if (!obj)
return -1;
*end = ((PyUnicodeErrorObject *)exc)->end;
- size = PyUnicode_GET_SIZE(obj);
+ size = PyUnicode_GET_LENGTH(obj);
if (*end<1)
*end = 1;
if (*end>size)
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 1e44357..6798ef8 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -4784,7 +4784,7 @@
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 @@
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++) {