Skip to content

Commit 93cf96d

Browse files
committed
Wait for process termination
1 parent 98ca669 commit 93cf96d

File tree

1 file changed

+3
-4
lines changed
  • src/python_testing/matter_testing_infrastructure/chip/testing

1 file changed

+3
-4
lines changed

src/python_testing/matter_testing_infrastructure/chip/testing/tasks.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ def forward_f(prefix: bytes,
2828
2929
This function can optionally feed received lines to a callback function.
3030
"""
31-
while True:
32-
line = f_in.readline()
33-
if not line:
34-
break
31+
while line := f_in.readline():
3532
if cb is not None:
3633
cb(line, is_stderr)
3734
f_out.buffer.write(prefix)
@@ -121,4 +118,6 @@ def send(self, message: str, end: str = "\n",
121118
self.expected_output = None
122119

123120
def terminate(self):
121+
"""Terminate the subprocess and wait for it to finish."""
124122
self.p.terminate()
123+
self.join()

0 commit comments

Comments
 (0)