summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-04 00:41:39 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-04 00:41:39 (GMT)
commitf15a29f975bbdef6de0aa19a19b176d1baf8f5ab (patch)
tree60f4f72289129eaa808e05f2b7c7fb7bde077371 /Python/ast.c
parentbae5cedb8d41edc20bea54b8bff0c7f835de8043 (diff)
downloadcpython-f15a29f975bbdef6de0aa19a19b176d1baf8f5ab.zip
cpython-f15a29f975bbdef6de0aa19a19b176d1baf8f5ab.tar.gz
cpython-f15a29f975bbdef6de0aa19a19b176d1baf8f5ab.tar.bz2
More coding by random modification.
Encoding now return bytes instead of str8. eval(), exec(), compile() now accept unicode or bytes.
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 821a5ad..5845076 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",