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__':
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