summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-11-21 01:49:52 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-11-21 01:49:52 (GMT)
commit9e30aa52fd416e17b692c4f22e57191cdd6ec654 (patch)
treef3b1c85f5cdbb6a32ec8f309400e8d3e1c2bbfaf /Objects
parentf3ae6208c706bae89d86df44c7c3dcac1bdcd94d (diff)
downloadcpython-9e30aa52fd416e17b692c4f22e57191cdd6ec654.zip
cpython-9e30aa52fd416e17b692c4f22e57191cdd6ec654.tar.gz
cpython-9e30aa52fd416e17b692c4f22e57191cdd6ec654.tar.bz2
Fix misuse of PyUnicode_GET_SIZE() => PyUnicode_GET_LENGTH()
And PyUnicode_GetSize() => PyUnicode_GetLength()
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bytesobject.c2
-rw-r--r--Objects/exceptions.c4
-rw-r--r--Objects/unicodeobject.c4
3 files changed, 5 insertions, 5 deletions
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 @@ _PyBytes_FormatLong(PyObject *val, int flags, int prec, int type,
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 @@ PyUnicodeEncodeError_GetStart(PyObject *exc, Py_ssize_t *start)
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 @@ PyUnicodeEncodeError_GetEnd(PyObject *exc, Py_ssize_t *end)
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 @@ _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++) {