Skip to content

Commit 894e46b

Browse files
committed
fix(stdio): close stdout on teardown
1 parent 1ed577f commit 894e46b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/mcp/client/stdio.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ async def stdin_writer():
205205
except ProcessLookupError: # pragma: no cover
206206
# Process already exited, which is fine
207207
pass
208+
209+
if process.stdout: # pragma: no branch
210+
try:
211+
await process.stdout.aclose()
212+
except Exception: # pragma: no cover
213+
pass
208214
await read_stream.aclose()
209215
await write_stream.aclose()
210216
await read_stream_writer.aclose()

0 commit comments

Comments
 (0)