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/bytesobject.c b/Objects/bytesobject.c
index 61ee42a..d0e4e26 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -87,13 +87,13 @@
/* share short strings */
if (size == 0) {
PyObject *t = (PyObject *)op;
- PyBytes_InternInPlace(&t);
+ PyString_InternInPlace(&t);
op = (PyBytesObject *)t;
nullstring = op;
Py_INCREF(op);
} else if (size == 1 && str != NULL) {
PyObject *t = (PyObject *)op;
- PyBytes_InternInPlace(&t);
+ PyString_InternInPlace(&t);
op = (PyBytesObject *)t;
characters[*str & UCHAR_MAX] = op;
Py_INCREF(op);
@@ -140,13 +140,13 @@
/* share short strings */
if (size == 0) {
PyObject *t = (PyObject *)op;
- PyBytes_InternInPlace(&t);
+ PyString_InternInPlace(&t);
op = (PyBytesObject *)t;
nullstring = op;
Py_INCREF(op);
} else if (size == 1) {
PyObject *t = (PyObject *)op;
- PyBytes_InternInPlace(&t);
+ PyString_InternInPlace(&t);
op = (PyBytesObject *)t;
characters[*str & UCHAR_MAX] = op;
Py_INCREF(op);
@@ -5093,12 +5093,12 @@
}
void
-PyBytes_InternInPlace(PyObject **p)
+PyString_InternInPlace(PyObject **p)
{
register PyBytesObject *s = (PyBytesObject *)(*p);
PyObject *t;
if (s == NULL || !PyBytes_Check(s))
- Py_FatalError("PyBytes_InternInPlace: strings only please!");
+ Py_FatalError("PyString_InternInPlace: strings only please!");
/* If it's a string subclass, we don't really know what putting
it in the interned dict might do. */
if (!PyBytes_CheckExact(s))
@@ -5131,9 +5131,9 @@
}
void
-PyBytes_InternImmortal(PyObject **p)
+PyString_InternImmortal(PyObject **p)
{
- PyBytes_InternInPlace(p);
+ PyString_InternInPlace(p);
if (PyBytes_CHECK_INTERNED(*p) != SSTATE_INTERNED_IMMORTAL) {
PyBytes_CHECK_INTERNED(*p) = SSTATE_INTERNED_IMMORTAL;
Py_INCREF(*p);
@@ -5142,17 +5142,17 @@
PyObject *
-PyBytes_InternFromString(const char *cp)
+PyString_InternFromString(const char *cp)
{
PyObject *s = PyBytes_FromString(cp);
if (s == NULL)
return NULL;
- PyBytes_InternInPlace(&s);
+ PyString_InternInPlace(&s);
return s;
}
void
-PyBytes_Fini(void)
+PyString_Fini(void)
{
int i;
for (i = 0; i < UCHAR_MAX + 1; i++) {