#NEWLINE# def flush( self , n = 4096 ) : #NEWLINE# #INDENT# '\n        Flush `n` bytes of data from the reader Stream to the writer Stream.\n\n        Returns the number of bytes that were actually flushed. A return value\n        of zero is not an error.\n\n        If EOF has been reached, `None` is returned.\n        ' #NEWLINE# try : #NEWLINE# #INDENT# read = self . from_stream . read ( n ) #NEWLINE# if ( ( read is None ) or ( len ( read ) == 0 ) ) : #NEWLINE# #INDENT# self . eof = True #NEWLINE# if self . propagate_close : #NEWLINE# #INDENT# self . to_stream . close ( ) #NEWLINE# #UNINDENT# return None #NEWLINE# #UNINDENT# return self . to_stream . write ( read ) #NEWLINE# #UNINDENT# except OSError as e : #NEWLINE# #INDENT# if ( e . errno != errno . EPIPE ) : #NEWLINE# #INDENT# raise e