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

Method __aenter__

Lib/contextlib.py:209–216  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

207 """Helper for @asynccontextmanager decorator."""
208
209 async def __aenter__(self):
210 # do not keep args and kwds alive unnecessarily
211 # they are only needed for recreation, which is not possible anymore
212 del self.args, self.kwds, self.func
213 try:
214 return await anext(self.gen)
215 except StopAsyncIteration:
216 raise RuntimeError("generator didn't yield") from None
217
218 async def __aexit__(self, typ, value, traceback):
219 if typ is None:

Callers

nothing calls this directly

Calls 1

anextFunction · 0.85

Tested by

no test coverage detected