MCPcopy
hub / github.com/modelcontextprotocol/python-sdk / __aexit__

Method __aexit__

src/mcp/client/session.py:262–273  ·  view source on GitHub ↗
(
        self,
        exc_type: type[BaseException] | None,
        exc_val: BaseException | None,
        exc_tb: TracebackType | None,
    )

Source from the content-addressed store, hash-verified

260 return self
261
262 async def __aexit__(
263 self,
264 exc_type: type[BaseException] | None,
265 exc_val: BaseException | None,
266 exc_tb: TracebackType | None,
267 ) -> bool | None:
268 # Exit must not block: cancel the dispatcher and in-flight callbacks.
269 assert self._task_group is not None
270 self._task_group.cancel_scope.cancel()
271 result = await self._task_group.__aexit__(exc_type, exc_val, exc_tb)
272 await resync_tracer()
273 return result
274
275 async def send_request(
276 self,

Callers 1

__aenter__Method · 0.45

Calls 1

resync_tracerFunction · 0.90

Tested by

no test coverage detected