#NEWLINE# def to_bytes( self ) : #NEWLINE# #INDENT# output = [ ] #NEWLINE# for maybe_text in self . output : #NEWLINE# #INDENT# if maybe_text : #NEWLINE# #INDENT# output . append ( ( b'\n    ' + five . to_bytes ( maybe_text ) . replace ( b'\n' , b'\n    ' ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# output . append ( b'(none)' ) #NEWLINE# #UNINDENT# #UNINDENT# return b'' . join ( ( five . to_bytes ( 'Command: {0!r}\nReturn code: {1}\nExpected return code: {2}\n' . format ( self . cmd , self . returncode , self . expected_returncode ) ) , b'Output: ' , output [ 0 ] , b'\n' , b'Errors: ' , output [ 1 ] , b'\n' ) )