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

Function _close_pipe

src/mcp/client/stdio.py:270–273  ·  view source on GitHub ↗

Closes a pipe stream, tolerating one already closed, broken, or contended.

(stream: AsyncResource)

Source from the content-addressed store, hash-verified

268
269
270async def _close_pipe(stream: AsyncResource) -> None:
271 """Closes a pipe stream, tolerating one already closed, broken, or contended."""
272 with suppress(OSError, anyio.BrokenResourceError, anyio.ClosedResourceError):
273 await stream.aclose()
274
275
276async def _wait_for_process_exit(process: ServerProcess, timeout: float) -> bool:

Callers 1

_stop_server_processFunction · 0.85

Calls 1

acloseMethod · 0.45

Tested by

no test coverage detected