summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-05-04 10:48:27 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-05-04 10:48:27 (GMT)
commit3cc3452e3c332f3187c15b6a5051a3ac3fe71a6f (patch)
treeac01d24221a5ba794cfbbaade34f679a081f4028 /Objects/unicodeobject.c
parentbf58bd6ddb1d6dd9aa80319886db744a802f4345 (diff)
downloadcpython-3cc3452e3c332f3187c15b6a5051a3ac3fe71a6f.zip
cpython-3cc3452e3c332f3187c15b6a5051a3ac3fe71a6f.tar.gz
cpython-3cc3452e3c332f3187c15b6a5051a3ac3fe71a6f.tar.bz2
Change PyUnicode_EncodeUTF16() so that it returns
bytes objects instead of str8 objects.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index d4a17ce..45c52cc 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1726,12 +1726,12 @@ PyUnicode_EncodeUTF16(const Py_UNICODE *s,
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)