(self, application)
Invoke the application
Invoke the application
Invoke the application
def run(self, application):
        """Invoke the application"""
        # Note to self: don't move the close()!  Asynchronous servers shouldn't
        # call close() from finish_response(), so if you close() anywhere but
        # the double-error branch here, you'll break asynchronous servers by
        # prematurely closing.  Async servers must return from 'run()' without
        # closing if there might still be output to iterate over.
        try:
            self.setup_environ()
            self.result = application(self.environ, self.start_response)
            self.finish_response()
        except (ConnectionAbortedError, BrokenPipeError, ConnectionResetError):
            # We expect the client to close the connection abruptly from time
            # to time.
            return
        except:
            try:
                self.handle_error()
            except:
                # If we get an error handling an error, just give up already!
                self.close()
                raise
def run ( self , application ) : # Note to self: don't move the close()!  Asynchronous servers shouldn't # call close() from finish_response(), so if you close() anywhere but # the double-error branch here, you'll break asynchronous servers by # prematurely closing.  Async servers must return from 'run()' without # closing if there might still be output to iterate over. try : self . setup_environ ( ) self . result = application ( self . environ , self . start_response ) self . finish_response ( ) except ( ConnectionAbortedError , BrokenPipeError , ConnectionResetError ) : # We expect the client to close the connection abruptly from time # to time. return except : try : self . handle_error ( ) except : # If we get an error handling an error, just give up already! self . close ( ) raise