diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-08-14 20:01:59 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-08-14 20:01:59 (GMT) |
commit | 481081e3693e1a7169cf8127725f7dc0e1750f29 (patch) | |
tree | 3815e1c65f3d1086f1ca1e2b85c6872e91a87eb8 | |
parent | 80e36750c8f6bfd41bb392ec223f4815acf8ae72 (diff) | |
download | cpython-481081e3693e1a7169cf8127725f7dc0e1750f29.zip cpython-481081e3693e1a7169cf8127725f7dc0e1750f29.tar.gz cpython-481081e3693e1a7169cf8127725f7dc0e1750f29.tar.bz2 |
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.
-rw-r--r-- | Python/compile.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c index 9a2d50b..21349ba 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; |