[issue14378] __future__ imports fail when compiling from python ast

2012-03-20 Thread J. D. Bartlett
J. D. Bartlett added the comment: Incidentally, the workaround that I'm using for the time being is to run the following code before attempting to compile root_node. for node in ast.walk(root_node): if isinstance(node, ast.ImportFrom) and node.module == '__future__':

[issue14378] __future__ imports fail when compiling from python ast

2012-03-20 Thread J. D. Bartlett
New submission from J. D. Bartlett : GOAL I am trying to compile an AST which contains an ImportFrom node which performs a __future__ import. The ImportFrom node in question is the first node within the AST's body (as it should be, because __future__ imports must occur at the beginni