mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +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
|
@ -696,9 +696,9 @@ tok_stdin_decode(struct tok_state *tok, char **inp)
|
|||
if (utf8 == NULL)
|
||||
goto error_clear;
|
||||
|
||||
assert(PyString_Check(utf8));
|
||||
converted = new_string(PyString_AS_STRING(utf8),
|
||||
PyString_GET_SIZE(utf8));
|
||||
assert(PyBytes_Check(utf8));
|
||||
converted = new_string(PyBytes_AS_STRING(utf8),
|
||||
PyBytes_GET_SIZE(utf8));
|
||||
Py_DECREF(utf8);
|
||||
if (converted == NULL)
|
||||
goto error_nomem;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue