mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
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.
This commit is contained in:
parent
e98839a1f4
commit
dd96db63f6
173 changed files with 2275 additions and 2280 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue