From 2f7bbffb5b2cfbd3f6c18484632bf7ecfe3a5148 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Fri, 4 Apr 2014 15:18:14 -0700 Subject: [PATCH] waiting to read stdout was blocking when the buffer filled --- winbuild/test.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/winbuild/test.py b/winbuild/test.py index 43e394d66..22f80eefe 100644 --- a/winbuild/test.py +++ b/winbuild/test.py @@ -14,11 +14,8 @@ def test_one(params): proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE) - proc.stdin.close() - status = proc.wait() - print ("Waiting on read: %s, %s" % params) - trace = proc.stdout.read() - proc.stdout.close() + (trace, stderr) = proc.communicate() + status = proc.returncode print ("Done with %s, %s -- %s" % (python, architecture, status )) return (python, architecture, status, trace) except Exception as msg: @@ -29,16 +26,15 @@ def test_one(params): if __name__=='__main__': os.chdir('..') - #pool = multiprocessing.Pool() - matrix = [(python, architecture) for python in pythons + pool = multiprocessing.Pool() + matrix = [(python, architecture) for python in pythons for architecture in ('', 'x64')] - results = map(test_one, matrix) + + results = pool.map(test_one, matrix) for (python, architecture, status, trace) in results: print ("%s%s: %s" % (python, architecture, status)) - -