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/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index f7d8d77..67700de 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -668,7 +668,7 @@
if (i != 0) {
if (i < 0)
return NULL;
- return PyBytes_FromString("[...]");
+ return PyString_FromString("[...]");
}
aslist = PySequence_List(deque);
@@ -677,16 +677,16 @@
return NULL;
}
if (((dequeobject *)deque)->maxlen != -1)
- fmt = PyBytes_FromFormat("deque(%%r, maxlen=%i)",
+ fmt = PyString_FromFormat("deque(%%r, maxlen=%i)",
((dequeobject *)deque)->maxlen);
else
- fmt = PyBytes_FromString("deque(%r)");
+ fmt = PyString_FromString("deque(%r)");
if (fmt == NULL) {
Py_DECREF(aslist);
Py_ReprLeave(deque);
return NULL;
}
- result = PyBytes_Format(fmt, aslist);
+ result = PyString_Format(fmt, aslist);
Py_DECREF(fmt);
Py_DECREF(aslist);
Py_ReprLeave(deque);
@@ -1298,14 +1298,14 @@
if (baserepr == NULL)
return NULL;
if (dd->default_factory == NULL)
- defrepr = PyBytes_FromString("None");
+ defrepr = PyString_FromString("None");
else
{
int status = Py_ReprEnter(dd->default_factory);
if (status != 0) {
if (status < 0)
return NULL;
- defrepr = PyBytes_FromString("...");
+ defrepr = PyString_FromString("...");
}
else
defrepr = PyObject_Repr(dd->default_factory);
@@ -1315,9 +1315,9 @@
Py_DECREF(baserepr);
return NULL;
}
- result = PyBytes_FromFormat("defaultdict(%s, %s)",
- PyBytes_AS_STRING(defrepr),
- PyBytes_AS_STRING(baserepr));
+ result = PyString_FromFormat("defaultdict(%s, %s)",
+ PyString_AS_STRING(defrepr),
+ PyString_AS_STRING(baserepr));
Py_DECREF(defrepr);
Py_DECREF(baserepr);
return result;