summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2003-02-10 08:21:10 (GMT)
committerJust van Rossum <just@letterror.com>2003-02-10 08:21:10 (GMT)
commit3aaf42c6139ed211a59b200130d1d205982b9818 (patch)
treef8bd6b0fd7101701a3eb8f5bc783cea962e59725 /Python/compile.c
parent4adc9abc32a26f5ce5e2dada33d019f31170b5be (diff)
downloadcpython-3aaf42c6139ed211a59b200130d1d205982b9818.zip
cpython-3aaf42c6139ed211a59b200130d1d205982b9818.tar.gz
cpython-3aaf42c6139ed211a59b200130d1d205982b9818.tar.bz2
patch #683515: "Add unicode support to compile(), eval() and exec"
Incorporated nnorwitz's comment re. Py__USING_UNICODE.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 01e961b..2b2a9d5 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -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 {