MCPcopy
hub / github.com/aio-libs/aiohttp / _DetachedRequestContextManager

Class _DetachedRequestContextManager

aiohttp/client.py:569–594  ·  aiohttp/client.py::_DetachedRequestContextManager

Source from the content-addressed store, hash-verified

567
568
569class _DetachedRequestContextManager(_RequestContextManager):
570
571 __slots__ = _RequestContextManager.__slots__ + (&class="cm">#x27;_session', )
572
573 def __init__(self, coro, session):
574 super().__init__(coro)
575 self._session = session
576
577 @asyncio.coroutine
578 def __iter__(self):
579 try:
580 return (yield from self._coro)
581 except:
582 self._session.close()
583 raise
584
585 if PY_35:
586 def __await__(self):
587 try:
588 return (yield from self._coro)
589 except:
590 self._session.close()
591 raise
592
593 def __del__(self):
594 self._session.detach()
595
596
597class _DetachedWSRequestContextManager(_WSRequestContextManager):

Callers 1

requestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected