#NEWLINE# def _print_process_output( self , process , input_ , capture , realtime ) : #NEWLINE# #INDENT# "read 'input_' (bytes) untill process is terminated\n        write 'input_' content to 'capture' (string) and 'realtime' stream\n        " #NEWLINE# while True : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# line = input_ . readline ( ) . decode ( self . encoding , self . decode_error ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# process . terminate ( ) #NEWLINE# input_ . read ( ) #NEWLINE# raise #NEWLINE# #UNINDENT# if ( not line ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# capture . write ( line ) #NEWLINE# if realtime : #NEWLINE# #INDENT# realtime . write ( line )