#NEWLINE# def call_application( self , application , catch_exc_info = False ) : #NEWLINE# #INDENT# "\n        Call the given WSGI application, returning ``(status_string,\n        headerlist, app_iter)``\n\n        Be sure to call ``app_iter.close()`` if it's there.\n\n        If catch_exc_info is true, then returns ``(status_string,\n        headerlist, app_iter, exc_info)``, where the fourth item may\n        be None, but won't be if there was an exception.  If you don't\n        do this and there was an exception, the exception will be\n        raised directly.\n        " #NEWLINE# if self . is_body_seekable : #NEWLINE# #INDENT# self . body_file_raw . seek ( 0 ) #NEWLINE# #UNINDENT# captured = [ ] #NEWLINE# output = [ ] #NEWLINE# def start_response( status , headers , exc_info = None ) : #NEWLINE# #INDENT# if ( ( exc_info is not None ) and ( not catch_exc_info ) ) : #NEWLINE# #INDENT# reraise ( exc_info ) #NEWLINE# #UNINDENT# captured [ : ] = [ status , headers , exc_info ] #NEWLINE# return output . append #NEWLINE# #UNINDENT# app_iter = application ( self . environ , start_response ) #NEWLINE# if ( output or ( not captured ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# output . extend ( app_iter ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# if hasattr ( self , 'close' ) : #NEWLINE# #INDENT# app_iter . close ( ) #NEWLINE# #UNINDENT# #UNINDENT# app_iter = output #NEWLINE# #UNINDENT# if catch_exc_info : #NEWLINE# #INDENT# return ( captured [ 0 ] , captured [ 1 ] , app_iter , captured [ 2 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( captured [ 0 ] , captured [ 1 ] , app_iter )