if self.closed or self._proc.stdin.is_closing():
return
self._proc.stdin.write(data)
- try:
- await self._proc.stdin.drain()
- except BrokenPipeError:
- LOGGER.warning("Attempted write to an already closed process")
+ await self._proc.stdin.drain()
def write_eof(self) -> None:
"""Write end of file to to process stdin."""
ConnectionResetError,
):
# already exited, race condition
- LOGGER.warning("Attempted write to an already closed process")
+ pass
async def communicate(self, input_data: bytes | None = None) -> tuple[bytes, bytes]:
"""Write bytes to process and read back results."""