diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2008-06-09 04:58:54 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2008-06-09 04:58:54 (GMT) |
commit | dd96db63f689e2f0d8ae5a1436b3b3395eec7de5 (patch) | |
tree | b2299acac9ce44fc488fc7b2ae2a44548cd5fbb8 /Modules/_collectionsmodule.c | |
parent | e98839a1f48b2915f1cc747884e64f4d6e4c8e7a (diff) | |
download | cpython-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 'Modules/_collectionsmodule.c')
-rw-r--r-- | Modules/_collectionsmodule.c | 18 |
1 files changed, 9 insertions, 9 deletions
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 @@ deque_repr(PyObject *deque) if (i != 0) { if (i < 0) return NULL; - return PyBytes_FromString("[...]"); + return PyString_FromString("[...]"); } aslist = PySequence_List(deque); @@ -677,16 +677,16 @@ deque_repr(PyObject *deque) 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 @@ defdict_repr(defdictobject *dd) 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 @@ defdict_repr(defdictobject *dd) 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; |