From f15a29f975bbdef6de0aa19a19b176d1baf8f5ab Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 4 May 2007 00:41:39 +0000 Subject: More coding by random modification. Encoding now return bytes instead of str8. eval(), exec(), compile() now accept unicode or bytes. --- Python/ast.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Python/ast.c') diff --git a/Python/ast.c b/Python/ast.c index 821a5ad278..58450766a4 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3101,8 +3101,9 @@ decode_unicode(const char *s, size_t len, int rawmode, const char *encoding) Py_DECREF(u); return NULL; } - r = PyString_AsString(w); - rn = PyString_Size(w); + assert(PyBytes_Check(w)); + r = PyBytes_AsString(w); + rn = PyBytes_Size(w); assert(rn % 2 == 0); for (i = 0; i < rn; i += 2) { sprintf(p, "\\u%02x%02x", -- cgit v1.2.1