#NEWLINE# def fork_and_wait( self , space , capfd , code ) : #NEWLINE# #INDENT# cpid = os . fork ( ) #NEWLINE# if ( cpid == 0 ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# space . execute ( code ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# os . _exit ( 0 ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# os . waitpid ( cpid , 0 ) #NEWLINE# ( out , err ) = capfd . readouterr ( ) #NEWLINE# return out