- 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.
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 @@
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):