]> granicus.if.org Git - python/commitdiff
Fix SF bug [ #450909 ] __future__.division fails at prompt
authorJeremy Hylton <jeremy@alum.mit.edu>
Tue, 14 Aug 2001 20:01:59 +0000 (20:01 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Tue, 14 Aug 2001 20:01:59 +0000 (20:01 +0000)
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.

Python/compile.c

index 9a2d50b0b5cd1e854a80d32f4be47e82d7271832..21349ba1148b4ccf45cbce56d8f0a22c30a37a74 100644 (file)
@@ -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;