summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pyrepl/test_pyrepl.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-06-19 13:14:29 (GMT)
committerGitHub <noreply@github.com>2024-06-19 13:14:29 (GMT)
commit0f3e36454d754026d6c510053ff1e4b22ae80cd9 (patch)
tree70cc67a8ca1119081d18424e42edb2af90e906aa /Lib/test/test_pyrepl/test_pyrepl.py
parentd8f27cb1141fd3575de816438ed80a916c0560ed (diff)
downloadcpython-0f3e36454d754026d6c510053ff1e4b22ae80cd9.zip
cpython-0f3e36454d754026d6c510053ff1e4b22ae80cd9.tar.gz
cpython-0f3e36454d754026d6c510053ff1e4b22ae80cd9.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_pyrepl/test_pyrepl.py')
-rw-r--r--Lib/test/test_pyrepl/test_pyrepl.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py
index 41ba595..adc55f2 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