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

Method finish_response

Lib/wsgiref/handlers.py:173–196  ·  view source on GitHub ↗

Send any iterable data, then close self and the iterable Subclasses intended for use in asynchronous servers will want to redefine this method, such that it sets up callbacks in the event loop to iterate over the data, and to call 'self.close()' once the response is

(self)

Source from the content-addressed store, hash-verified

171
172
173 def finish_response(self):
174 """Send any iterable data, then close self and the iterable
175
176 Subclasses intended for use in asynchronous servers will
177 want to redefine this method, such that it sets up callbacks
178 in the event loop to iterate over the data, and to call
179 'self.close()' once the response is finished.
180 """
181 try:
182 if not self.result_is_file() or not self.sendfile():
183 for data in self.result:
184 self.write(data)
185 self.finish_content()
186 except:
187 # Call close() on the iterable returned by the WSGI application
188 # in case of an exception.
189 if hasattr(self.result, 'close'):
190 self.result.close()
191 raise
192 else:
193 # We only call close() when no exception is raised, because it
194 # will set status, result, headers, and environ fields to None.
195 # See bpo-29183 for more details.
196 self.close()
197
198
199 def get_scheme(self):

Callers 2

runMethod · 0.95
handle_errorMethod · 0.95

Calls 6

result_is_fileMethod · 0.95
sendfileMethod · 0.95
writeMethod · 0.95
finish_contentMethod · 0.95
closeMethod · 0.95
hasattrFunction · 0.85

Tested by

no test coverage detected