#NEWLINE# def future_import2( feature , node ) : #NEWLINE# #INDENT# '\n    An alternative to future_import() which might not work ...\n    ' #NEWLINE# root = find_root ( node ) #NEWLINE# if does_tree_import ( '__future__' , feature , node ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# insert_pos = 0 #NEWLINE# for ( idx , node ) in enumerate ( root . children ) : #NEWLINE# #INDENT# if ( ( node . type == syms . simple_stmt ) and node . children and ( node . children [ 0 ] . type == token . STRING ) ) : #NEWLINE# #INDENT# insert_pos = ( idx + 1 ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# for thing_after in root . children [ insert_pos : ] : #NEWLINE# #INDENT# if ( thing_after . type == token . NEWLINE ) : #NEWLINE# #INDENT# insert_pos += 1 #NEWLINE# continue #NEWLINE# #UNINDENT# prefix = thing_after . prefix #NEWLINE# thing_after . prefix = '' #NEWLINE# break #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# prefix = '' #NEWLINE# #UNINDENT# import_ = FromImport ( '__future__' , [ Leaf ( token . NAME , feature , prefix = ' ' ) ] ) #NEWLINE# children = [ import_ , Newline ( ) ] #NEWLINE# root . insert_child ( insert_pos , Node ( syms . simple_stmt , children , prefix = prefix ) )