#NEWLINE# def handle_endtag( self , tag ) : #NEWLINE# #INDENT# if ( tag in self . tag_stack ) : #NEWLINE# #INDENT# for t in self . tag_stack [ : : ( - 1 ) ] : #NEWLINE# #INDENT# if ( t == tag ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# self . handle_endtag ( t ) #NEWLINE# #UNINDENT# assert ( self . tag_stack [ ( - 1 ) ] == tag ) #NEWLINE# self . tag_stack . pop ( ) #NEWLINE# self . builder . end_element ( tag ) #NEWLINE# if ( self . current_dtd . name == tag ) : #NEWLINE# #INDENT# self . current_dtd = self . current_dtd . parent