Commit 64088e8a authored by Jérome Perrin's avatar Jérome Perrin Committed by Kirill Smelkov

gpython: Don't inherit __future__ when executing scripts

Because we use execfile to emulate "python script.py" invocation, future
enabled in gpython main script are also enabled in "script.py" and because
we use print_function feature, it was also applied in "script.py".
On python 2 when "script.py" uses print statements they were considered as
SyntaxError.

Hopefuly, compile has a `dont_inherit` flag which does exactly what we need
here: compile the script without inheriting futures enabled, so we use
compile with this flag.

/reviewed-by @kirr
/reviewed-on !8
parent d5b1eca0
Pipeline #12478 passed with stage
in 0 seconds