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 /Objects/bytesobject.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 'Objects/bytesobject.c')
-rw-r--r-- | Objects/bytesobject.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 61ee42ab..d0e4e26 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -87,13 +87,13 @@ PyBytes_FromStringAndSize(const char *str, Py_ssize_t size) /* 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 @@ PyBytes_FromString(const char *str) /* 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 @@ PyBytes_Format(PyObject *format, PyObject *args) } 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 @@ PyBytes_InternInPlace(PyObject **p) } 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 @@ PyBytes_InternImmortal(PyObject **p) 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++) { |