Mercurial > cpython-lru_cache-weakref
diff Objects/bytesobject.c @ 47527:52294af4b663 legacy-trunk
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.
| author | Gregory P. Smith <greg@mad-scientist.com> |
|---|---|
| date | Mon, 09 Jun 2008 04:58:54 +0000 |
| parents | a65f095b27f3 |
| children | acda43252710 |
line wrap: on
line diff
--- a/Objects/bytesobject.c Mon Jun 09 01:28:30 2008 +0000 +++ b/Objects/bytesobject.c Mon Jun 09 04:58:54 2008 +0000 @@ -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++) {
