From: Victor Stinner Date: Wed, 19 Jun 2024 13:14:29 +0000 (+0200) Subject: gh-120635: Avoid leaking processes in test_pyrepl (#120676) X-Git-Tag: v3.14.0a1~1413 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0f3e36454d754026d6c510053ff1e4b22ae80cd9;p=thirdparty%2FPython%2Fcpython.git gh-120635: Avoid leaking processes in test_pyrepl (#120676) If the child process takes longer than SHORT_TIMEOUT seconds to complete, kill the process but then wait until it completes with no timeout to not leak child processes. --- diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index 41ba5959a1ec..adc55f28f08a 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -890,5 +890,5 @@ class TestMain(TestCase): exit_code = process.wait(timeout=SHORT_TIMEOUT) except subprocess.TimeoutExpired: process.kill() - exit_code = process.returncode + exit_code = process.wait() return "\n".join(output), exit_code