#NEWLINE# def streaming_iter( self , reg , environ , start_response ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# for item in self . application ( environ , start_response ) : #NEWLINE# #INDENT# ( yield item ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# if environ . get ( 'paste.evalexception' ) : #NEWLINE# #INDENT# expected = False #NEWLINE# for expect in environ . get ( 'paste.expected_exceptions' , [ ] ) : #NEWLINE# #INDENT# if isinstance ( e , expect ) : #NEWLINE# #INDENT# expected = True #NEWLINE# #UNINDENT# #UNINDENT# if ( not expected ) : #NEWLINE# #INDENT# restorer . save_registry_state ( environ ) #NEWLINE# #UNINDENT# #UNINDENT# reg . cleanup ( ) #NEWLINE# raise #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# if environ . get ( 'paste.evalexception' ) : #NEWLINE# #INDENT# restorer . save_registry_state ( environ ) #NEWLINE# #UNINDENT# reg . cleanup ( ) #NEWLINE# raise #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# reg . cleanup ( )