Skip to content

Commit b996778

Browse files
test stdout close
1 parent 08808f3 commit b996778

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/mcp/client/stdio/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ async def stdin_writer():
188188
# stdin might already be closed, which is fine
189189
pass
190190

191+
if process.stdout:
192+
try:
193+
await process.stdout.aclose()
194+
except Exception:
195+
# stdout might already be closed, which is fine
196+
pass
197+
191198
try:
192199
# Give the process time to exit gracefully after stdin closes
193200
with anyio.fail_after(2.0):

0 commit comments

Comments
 (0)