From 068d5724d82e065fc636814e332078edd7cb30fe Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 20 Apr 1999 12:27:31 +0000 Subject: Calling _cleanup() does not guarantee that all processes have terminated; this makes the final assert in the self-test code fail if the parent runs faster than the children. Fix this by calling wait() on the remaining children instead. --- Lib/popen2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/popen2.py b/Lib/popen2.py index 4c42958..d4b5d26 100644 --- a/Lib/popen2.py +++ b/Lib/popen2.py @@ -91,7 +91,8 @@ def _test(): w.close() assert r.read() == teststr assert e.read() == "" - _cleanup() + for inst in _active[:]: + inst.wait() assert not _active print "All OK" -- cgit v0.12