MCPcopy Index your code
hub / github.com/python/cpython / run

Method run

Lib/wsgiref/handlers.py:129–150  ·  view source on GitHub ↗

Invoke the application

(self, application)

Source from the content-addressed store, hash-verified

127 bytes_sent = 0
128
129 def run(self, application):
130 """Invoke the application"""
131 # Note to self: don't move the close()! Asynchronous servers shouldn't
132 # call close() from finish_response(), so if you close() anywhere but
133 # the double-error branch here, you'll break asynchronous servers by
134 # prematurely closing. Async servers must return from 'run()' without
135 # closing if there might still be output to iterate over.
136 try:
137 self.setup_environ()
138 self.result = application(self.environ, self.start_response)
139 self.finish_response()
140 except (ConnectionAbortedError, BrokenPipeError, ConnectionResetError):
141 # We expect the client to close the connection abruptly from time
142 # to time.
143 return
144 except:
145 try:
146 self.handle_error()
147 except:
148 # If we get an error handling an error, just give up already!
149 self.close()
150 raise # ...and let the actual server figure it out.
151
152
153 def setup_environ(self):

Callers 1

handleMethod · 0.45

Calls 4

setup_environMethod · 0.95
finish_responseMethod · 0.95
handle_errorMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected