[issue14378] __future__ imports fail when compiling from python ast

J. D. Bartlett report at bugs.python.org
Wed Mar 21 07:23:38 CET 2012

J. D. Bartlett <josh at bartletts.id.au> 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__':
        node.module = '__future__'


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list