MCPcopy
hub / github.com/cherrypy/cherrypy / close

Method close

cherrypy/_cpwsgi.py:279–296  ·  view source on GitHub ↗

Close and de-reference the current request and response. (Core)

(self)

Source from the content-addressed store, hash-verified

277 return next(self.iter_response)
278
279 def close(self):
280 """Close and de-reference the current request and response.
281
282 (Core)
283 """
284 streaming = _cherrypy.serving.response.stream
285 self.cpapp.release_serving()
286
287 # We avoid the expense of examining the iterator to see if it's
288 # closable unless we are streaming the response, as that's the
289 # only situation where we are going to have an iterator which
290 # may not have been exhausted yet.
291 if streaming and is_closable_iterator(self.iter_response):
292 iter_close = self.iter_response.close
293 try:
294 iter_close()
295 except Exception:
296 _cherrypy.log(traceback=True, severity=40)
297
298 def run(self):
299 """Create a Request object using environ."""

Callers 3

__init__Method · 0.95
__call__Method · 0.45
closeMethod · 0.45

Calls 3

is_closable_iteratorFunction · 0.90
release_servingMethod · 0.80
logMethod · 0.80

Tested by

no test coverage detected