Skip to content

Commit

Permalink
Wait for process termination
Browse files Browse the repository at this point in the history
  • Loading branch information
arkq committed Sep 19, 2024
1 parent 98ca669 commit 93cf96d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ def forward_f(prefix: bytes,
This function can optionally feed received lines to a callback function.
"""
while True:
line = f_in.readline()
if not line:
break
while line := f_in.readline():
if cb is not None:
cb(line, is_stderr)
f_out.buffer.write(prefix)
Expand Down Expand Up @@ -121,4 +118,6 @@ def send(self, message: str, end: str = "\n",
self.expected_output = None

def terminate(self):
"""Terminate the subprocess and wait for it to finish."""
self.p.terminate()
self.join()

0 comments on commit 93cf96d

Please sign in to comment.