MCPcopy Index your code
hub / github.com/RustPython/RustPython / run

Method run

Lib/wsgiref/handlers.py:128–149  ·  view source on GitHub ↗

Invoke the application

(self, application)

Source from the content-addressed store, hash-verified

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