#NEWLINE# def action( stage_dir , root , path ) : #NEWLINE# #INDENT# command = [ sys . executable , os . path . join ( '..' , '..' , 'bin' , 'nuitka' ) , '--stand' , '--run' , '--output-dir' , stage_dir , '--remove-output' ] #NEWLINE# filename = os . path . join ( stage_dir , 'importer.py' ) #NEWLINE# assert path . startswith ( root ) #NEWLINE# module_name = path [ ( len ( root ) + 1 ) : ] #NEWLINE# module_name = module_name . split ( '.' ) [ 0 ] #NEWLINE# module_name = module_name . replace ( os . path . sep , '.' ) #NEWLINE# with open ( filename , 'w' ) as output : #NEWLINE# #INDENT# output . write ( ( ( 'import ' + module_name ) + '\n' ) ) #NEWLINE# output . write ( "print('OK')" ) #NEWLINE# #UNINDENT# command += os . environ . get ( 'NUITKA_EXTRA_OPTIONS' , '' ) . split ( ) #NEWLINE# command . append ( filename ) #NEWLINE# try : #NEWLINE# #INDENT# output = subprocess . check_output ( command ) . splitlines ( ) #NEWLINE# assert ( output [ ( - 1 ) ] == 'OK' ) , output #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# print ( e ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# my_print ( 'OK' ) #NEWLINE# shutil . rmtree ( ( filename [ : ( - 3 ) ] + '.dist' ) )