Skip to content

Commit 141d491

Browse files
committed
Address review
1 parent 198027a commit 141d491

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Lib/test/libregrtest/runtest_mp.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def _run_process(self, test_name: str, tmp_dir: str, stdout_fh: TextIO) -> int:
235235

236236
try:
237237
# gh-94026: stdout+stderr are written to tempfile
238-
popen.communicate(timeout=self.timeout)
238+
popen.wait(timeout=self.timeout)
239239
retcode = popen.returncode
240240
assert retcode is not None
241241
return retcode
@@ -270,7 +270,9 @@ def _run_process(self, test_name: str, tmp_dir: str, stdout_fh: TextIO) -> int:
270270
def _runtest(self, test_name: str) -> MultiprocessResult:
271271
# gh-94026: Write stdout+stderr to a tempfile as workaround for
272272
# non-blocking pipes on Emscripten with NodeJS.
273-
with tempfile.TemporaryFile('w+') as stdout_fh:
273+
with tempfile.TemporaryFile(
274+
'w+', encoding=sys.stdout.encoding
275+
) as stdout_fh:
274276
# gh-93353: Check for leaked temporary files in the parent process,
275277
# since the deletion of temporary files can happen late during
276278
# Python finalization: too late for libregrtest.

0 commit comments

Comments
 (0)