diff options
author | Gregory P. Smith <greg@krypto.org> | 2011-05-12 04:42:08 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2011-05-12 04:42:08 (GMT) |
commit | 6b65745430245937c7ee088cffa22a2d419396e2 (patch) | |
tree | 975201beeeb96eb54b9c8fcc47468ea33ddb3db8 /Lib/test | |
parent | 4e19e1195817891fdc4ce4c3f0eddde845bf3214 (diff) | |
download | cpython-6b65745430245937c7ee088cffa22a2d419396e2.zip cpython-6b65745430245937c7ee088cffa22a2d419396e2.tar.gz cpython-6b65745430245937c7ee088cffa22a2d419396e2.tar.bz2 |
- Issue #12044: Fixed subprocess.Popen when used as a context manager to
wait for the process to end when exiting the context to avoid unintentionally
leaving zombie processes around.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_subprocess.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index e8abfef..776e143 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1590,7 +1590,8 @@ class ContextManagerTests(ProcessTestCase): def test_returncode(self): with subprocess.Popen([sys.executable, "-c", "import sys; sys.exit(100)"]) as proc: - proc.wait() + pass + # __exit__ calls wait(), so the returncode should be set self.assertEqual(proc.returncode, 100) def test_communicate_stdin(self): |