mirror of
https://github.com/python/cpython.git
synced 2025-09-05 00:11:10 +00:00
patch #683515: "Add unicode support to compile(), eval() and exec"
Incorporated nnorwitz's comment re. Py__USING_UNICODE.
This commit is contained in:
parent
4adc9abc32
commit
3aaf42c613
5 changed files with 61 additions and 9 deletions
|
@ -4206,7 +4206,9 @@ jcompile(node *n, const char *filename, struct compiling *base,
|
|||
PyCodeObject *co;
|
||||
if (!com_init(&sc, filename))
|
||||
return NULL;
|
||||
if (TYPE(n) == encoding_decl) {
|
||||
if (flags && flags->cf_flags & PyCF_SOURCE_IS_UTF8) {
|
||||
sc.c_encoding = "utf-8";
|
||||
} else if (TYPE(n) == encoding_decl) {
|
||||
sc.c_encoding = STR(n);
|
||||
n = CHILD(n, 0);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue