We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 37b54b4 commit c578212Copy full SHA for c578212
src/mcp/client/stdio/__init__.py
@@ -181,6 +181,8 @@ async def stdin_writer():
181
await terminate_windows_process(process)
182
else:
183
process.terminate()
184
+ await read_stream.aclose()
185
+ await write_stream.aclose()
186
187
188
def _get_executable_command(command: str) -> str:
tests/client/test_stdio.py
@@ -9,6 +9,13 @@
9
tee: str = shutil.which("tee") # type: ignore
10
11
12
+@pytest.mark.anyio
13
+@pytest.mark.skipif(tee is None, reason="could not find tee command")
14
+async def test_stdio_context_manager_exiting():
15
+ async with stdio_client(StdioServerParameters(command=tee)) as (_, _):
16
+ pass
17
+
18
19
@pytest.mark.anyio
20
@pytest.mark.skipif(tee is None, reason="could not find tee command")
21
async def test_stdio_client():
0 commit comments