summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-08-14 20:01:59 +0000
committerJeremy Hylton <jeremy@alum.mit.edu>2001-08-14 20:01:59 +0000
commitefa10012ce46cff410da210dd4cde57a22241ffc (patch)
treed5423fb61cb10f7ecbf168f99b1986fe85891634 /Python/compile.c
parenta333ec9bba50f3c41df2a213127fc75e2ce8c84f (diff)
downloadcpython-efa10012ce46cff410da210dd4cde57a22241ffc.tar.gz
Fix SF bug [ #450909 ] __future__.division fails at prompt
When code is compiled and compiler flags are passed in, be sure to update cf_flags with any features defined by future statements in the compiled code.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 9a2d50b0b5..21349ba114 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -4027,8 +4027,12 @@ jcompile(node *n, char *filename, struct compiling *base,
com_free(&sc);
return NULL;
}
- if (flags)
- sc.c_future->ff_features |= flags->cf_flags;
+ if (flags) {
+ int merged = sc.c_future->ff_features |
+ flags->cf_flags;
+ sc.c_future->ff_features = merged;
+ flags->cf_flags = merged;
+ }
if (symtable_build(&sc, n) < 0) {
com_free(&sc);
return NULL;