Python icon indicating copy to clipboard operation
Python copied to clipboard

future imports fix

Open dosmoc opened this issue 10 years ago • 1 comments

Accumulate and add compiler flags to calls to the compile function for eval/exec code in handleEval when features that alter syntax are imported from the future module. The problem was first reported in issue LightTable/Python/#23. More details are in LightTable/Python/#33. Allows the following code to be executed using Python2 without a syntax error:

from __future__ import print_function
import sys

print('spam', file=sys.stderr)

Does not resolve all of the problems with printing to sys.stderr mentioned in LightTable/Python/#23, just the SyntaxError.

dosmoc avatar Sep 09 '15 20:09 dosmoc

@hayd @UnknownProgrammer Mind reviewing this?

kenny-evitt avatar Sep 10 '15 13:09 kenny-evitt