From: Guido van Rossum Date: Tue, 20 Apr 1999 12:27:31 +0000 (+0000) Subject: Calling _cleanup() does not guarantee that all processes have X-Git-Tag: v1.6a1~1578 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=068d5724d82e065fc636814e332078edd7cb30fe;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/popen2.py b/Lib/popen2.py index 4c4295891338..d4b5d266cb06 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"