Fix hanging on streams when stdio_client exiting (#559)

This commit is contained in:
Lion Yang
2025-05-14 01:36:33 +08:00
committed by GitHub
parent 37b54b4c03
commit c5782129bc
2 changed files with 9 additions and 0 deletions

View File

@@ -181,6 +181,8 @@ async def stdio_client(server: StdioServerParameters, errlog: TextIO = sys.stder
await terminate_windows_process(process)
else:
process.terminate()
await read_stream.aclose()
await write_stream.aclose()
def _get_executable_command(command: str) -> str: