Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 481081e

Browse files
committed
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.
1 parent 80e3675 commit 481081e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Python/compile.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4027,8 +4027,12 @@ jcompile(node *n, char *filename, struct compiling *base,
40274027
com_free(&sc);
40284028
return NULL;
40294029
}
4030-
if (flags)
4031-
sc.c_future->ff_features |= flags->cf_flags;
4030+
if (flags) {
4031+
int merged = sc.c_future->ff_features |
4032+
flags->cf_flags;
4033+
sc.c_future->ff_features = merged;
4034+
flags->cf_flags = merged;
4035+
}
40324036
if (symtable_build(&sc, n) < 0) {
40334037
com_free(&sc);
40344038
return NULL;

0 commit comments

Comments
 (0)