summaryrefslogtreecommitdiff
path: root/Python/codecs.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-06-09 04:58:54 +0000
committerGregory P. Smith <greg@mad-scientist.com>2008-06-09 04:58:54 +0000
commitdd96db63f689e2f0d8ae5a1436b3b3395eec7de5 (patch)
treeb2299acac9ce44fc488fc7b2ae2a44548cd5fbb8 /Python/codecs.c
parente98839a1f48b2915f1cc747884e64f4d6e4c8e7a (diff)
downloadcpython-git-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.gz
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 'Python/codecs.c')
-rw-r--r--Python/codecs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/codecs.c b/Python/codecs.c
index 0e8cdc74d7..4b0f4cb0d0 100644
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -61,10 +61,10 @@ PyObject *normalizestring(const char *string)
return NULL;
}
- v = PyBytes_FromStringAndSize(NULL, len);
+ v = PyString_FromStringAndSize(NULL, len);
if (v == NULL)
return NULL;
- p = PyBytes_AS_STRING(v);
+ p = PyString_AS_STRING(v);
for (i = 0; i < len; i++) {
register char ch = string[i];
if (ch == ' ')
@@ -112,7 +112,7 @@ PyObject *_PyCodec_Lookup(const char *encoding)
v = normalizestring(encoding);
if (v == NULL)
goto onError;
- PyBytes_InternInPlace(&v);
+ PyString_InternInPlace(&v);
/* First, try to lookup the name in the registry dictionary */
result = PyDict_GetItem(interp->codec_search_cache, v);
@@ -190,7 +190,7 @@ PyObject *args_tuple(PyObject *object,
if (errors) {
PyObject *v;
- v = PyBytes_FromString(errors);
+ v = PyString_FromString(errors);
if (v == NULL) {
Py_DECREF(args);
return NULL;
@@ -451,7 +451,7 @@ static void wrong_exception_type(PyObject *exc)
if (string != NULL) {
PyErr_Format(PyExc_TypeError,
"don't know how to handle %.400s in error callback",
- PyBytes_AS_STRING(string));
+ PyString_AS_STRING(string));
Py_DECREF(string);
}
}