mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
More coding by random modification.
Encoding now return bytes instead of str8. eval(), exec(), compile() now accept unicode or bytes.
This commit is contained in:
parent
bae5cedb8d
commit
f15a29f975
12 changed files with 185 additions and 155 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue