#NEWLINE# def _flush_unlocked( self ) : #NEWLINE# #INDENT# self . _checkClosed ( 'flush of closed file' ) #NEWLINE# while self . _write_buf : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# n = self . raw . write ( bytes ( self . _write_buf ) ) #NEWLINE# #UNINDENT# except io . BlockingIOError as e : #NEWLINE# #INDENT# n = e . characters_written #NEWLINE# #UNINDENT# del self . _write_buf [ : n ]