MCPcopy
hub / github.com/django/django / aclosing_iterator_wrapper

Function aclosing_iterator_wrapper

django/test/client.py:129–136  ·  view source on GitHub ↗
(iterable, close)

Source from the content-addressed store, hash-verified

127
128
129async def aclosing_iterator_wrapper(iterable, close):
130 try:
131 async for chunk in iterable:
132 yield chunk
133 finally:
134 request_finished.disconnect(close_old_connections)
135 close() # will fire request_finished
136 request_finished.connect(close_old_connections)
137
138
139def conditional_content_removal(request, response):

Callers 2

__call__Method · 0.85
__call__Method · 0.85

Calls 2

disconnectMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected