Mercurial > cpython-lru_cache-weakref
diff Objects/unicodeobject.c @ 41605:1162502a09da
Change PyUnicode_EncodeUTF16() so that it returns
bytes objects instead of str8 objects.
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Fri, 04 May 2007 10:48:27 +0000 |
| parents | ca448c607b14 |
| children | 61acfb831633 |
line wrap: on
line diff
--- a/Objects/unicodeobject.c Fri May 04 07:18:10 2007 +0000 +++ b/Objects/unicodeobject.c Fri May 04 10:48:27 2007 +0000 @@ -1726,12 +1726,12 @@ if (s[i] >= 0x10000) pairs++; #endif - v = PyString_FromStringAndSize(NULL, + v = PyBytes_FromStringAndSize(NULL, 2 * (size + pairs + (byteorder == 0))); if (v == NULL) return NULL; - p = (unsigned char *)PyString_AS_STRING(v); + p = (unsigned char *)PyBytes_AS_STRING(v); if (byteorder == 0) STORECHAR(0xFEFF); if (size == 0)
