Mercurial > cpython-lru_cache-weakref
diff Python/codecs.c @ 47294:4fe192d48960 legacy-trunk
Renamed PyString to PyBytes
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Mon, 26 May 2008 12:51:38 +0000 |
| parents | 6f042f5bf94d |
| children | 52294af4b663 |
line wrap: on
line diff
--- a/Python/codecs.c Mon May 26 12:29:46 2008 +0000 +++ b/Python/codecs.c Mon May 26 12:51:38 2008 +0000 @@ -61,10 +61,10 @@ return NULL; } - v = PyString_FromStringAndSize(NULL, len); + v = PyBytes_FromStringAndSize(NULL, len); if (v == NULL) return NULL; - p = PyString_AS_STRING(v); + p = PyBytes_AS_STRING(v); for (i = 0; i < len; i++) { register char ch = string[i]; if (ch == ' ') @@ -112,7 +112,7 @@ v = normalizestring(encoding); if (v == NULL) goto onError; - PyString_InternInPlace(&v); + PyBytes_InternInPlace(&v); /* First, try to lookup the name in the registry dictionary */ result = PyDict_GetItem(interp->codec_search_cache, v); @@ -190,7 +190,7 @@ if (errors) { PyObject *v; - v = PyString_FromString(errors); + v = PyBytes_FromString(errors); if (v == NULL) { Py_DECREF(args); return NULL; @@ -451,7 +451,7 @@ if (string != NULL) { PyErr_Format(PyExc_TypeError, "don't know how to handle %.400s in error callback", - PyString_AS_STRING(string)); + PyBytes_AS_STRING(string)); Py_DECREF(string); } }
