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.
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 @@
}
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 @@
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 @@
/* 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 @@
{
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;