summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-06-09 04:58:54 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-06-09 04:58:54 (GMT)
commitdd96db63f689e2f0d8ae5a1436b3b3395eec7de5 (patch)
treeb2299acac9ce44fc488fc7b2ae2a44548cd5fbb8 /Objects/listobject.c
parente98839a1f48b2915f1cc747884e64f4d6e4c8e7a (diff)
downloadcpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.zip
cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.gz
cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.bz2
This reverts r63675 based on the discussion in this thread:
http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 796e8cb..e72f81f 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -174,7 +174,7 @@ PyList_GetItem(PyObject *op, Py_ssize_t i)
}
if (i < 0 || i >= Py_SIZE(op)) {
if (indexerr == NULL)
- indexerr = PyBytes_FromString(
+ indexerr = PyString_FromString(
"list index out of range");
PyErr_SetObject(PyExc_IndexError, indexerr);
return NULL;
@@ -349,11 +349,11 @@ list_repr(PyListObject *v)
i = Py_ReprEnter((PyObject*)v);
if (i != 0) {
- return i > 0 ? PyBytes_FromString("[...]") : NULL;
+ return i > 0 ? PyString_FromString("[...]") : NULL;
}
if (Py_SIZE(v) == 0) {
- result = PyBytes_FromString("[]");
+ result = PyString_FromString("[]");
goto Done;
}
@@ -379,29 +379,29 @@ list_repr(PyListObject *v)
/* Add "[]" decorations to the first and last items. */
assert(PyList_GET_SIZE(pieces) > 0);
- s = PyBytes_FromString("[");
+ s = PyString_FromString("[");
if (s == NULL)
goto Done;
temp = PyList_GET_ITEM(pieces, 0);
- PyBytes_ConcatAndDel(&s, temp);
+ PyString_ConcatAndDel(&s, temp);
PyList_SET_ITEM(pieces, 0, s);
if (s == NULL)
goto Done;
- s = PyBytes_FromString("]");
+ s = PyString_FromString("]");
if (s == NULL)
goto Done;
temp = PyList_GET_ITEM(pieces, PyList_GET_SIZE(pieces) - 1);
- PyBytes_ConcatAndDel(&temp, s);
+ PyString_ConcatAndDel(&temp, s);
PyList_SET_ITEM(pieces, PyList_GET_SIZE(pieces) - 1, temp);
if (temp == NULL)
goto Done;
/* Paste them all together with ", " between. */
- s = PyBytes_FromString(", ");
+ s = PyString_FromString(", ");
if (s == NULL)
goto Done;
- result = _PyBytes_Join(s, pieces);
+ result = _PyString_Join(s, pieces);
Py_DECREF(s);
Done:
@@ -433,7 +433,7 @@ list_item(PyListObject *a, Py_ssize_t i)
{
if (i < 0 || i >= Py_SIZE(a)) {
if (indexerr == NULL)
- indexerr = PyBytes_FromString(
+ indexerr = PyString_FromString(
"list index out of range");
PyErr_SetObject(PyExc_IndexError, indexerr);
return NULL;