[pypy-svn] pypy default: use communicate() to make sure that stdout/err are actually closed, else we leak file descriptors

antocuni commits-noreply at bitbucket.org
Fri Mar 18 10:59:21 CET 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 
Changeset: r42775:491a8d97fba5
Date: 2011-03-18 10:58 +0100
http://bitbucket.org/pypy/pypy/changeset/491a8d97fba5/

Log:	use communicate() to make sure that stdout/err are actually closed,
	else we leak file descriptors

diff --git a/pypy/module/pypyjit/test_pypy_c/test_model.py b/pypy/module/pypyjit/test_pypy_c/test_model.py
--- a/pypy/module/pypyjit/test_pypy_c/test_model.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_model.py
@@ -51,9 +51,7 @@
                                 env=env,
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
-        pipe.wait()
-        stderr = pipe.stderr.read()
-        stdout = pipe.stdout.read()
+        stdout, stderr = pipe.communicate()
         assert not stderr
         #
         # parse the JIT log


More information about the Pypy-commit mailing list