#NEWLINE# def output_difference( self , example , got , optionflags ) : #NEWLINE# #INDENT# actual = RealOutputChecker . output_difference ( self , example , got , optionflags ) #NEWLINE# want_xml = got_xml = None #NEWLINE# try : #NEWLINE# #INDENT# want_xml = make_xml ( example . want ) #NEWLINE# want_norm = make_string ( want_xml ) #NEWLINE# #UNINDENT# except XMLParseError as e : #NEWLINE# #INDENT# if example . want . startswith ( '<' ) : #NEWLINE# #INDENT# want_norm = ( '(bad XML: %s)' % e ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return actual #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# got_xml = make_xml ( got ) #NEWLINE# got_norm = make_string ( got_xml ) #NEWLINE# #UNINDENT# except XMLParseError as e : #NEWLINE# #INDENT# if example . want . startswith ( '<' ) : #NEWLINE# #INDENT# got_norm = ( '(bad XML: %s)' % e ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return actual #NEWLINE# #UNINDENT# #UNINDENT# s = ( '%s\nXML Wanted: %s\nXML Got   : %s\n' % ( actual , want_norm , got_norm ) ) #NEWLINE# if ( got_xml and want_xml ) : #NEWLINE# #INDENT# result = [ ] #NEWLINE# xml_compare ( want_xml , got_xml , result . append ) #NEWLINE# s += ( 'Difference report:\n%s\n' % '\n' . join ( result ) ) #NEWLINE# #UNINDENT# return s