From 18d3b4809f11122bced4c1368177e0fd0710ae58 Mon Sep 17 00:00:00 2001 From: Siu Kwan Lam Date: Sat, 5 Oct 2013 13:55:26 +0800 Subject: [PATCH] Fix py2.6--use Popen instead of check_output --- llvm/tests/__init__.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/llvm/tests/__init__.py b/llvm/tests/__init__.py index 0d95c7b..483201b 100644 --- a/llvm/tests/__init__.py +++ b/llvm/tests/__init__.py @@ -45,10 +45,16 @@ def run(verbosity=1): for test in isolated_tests: print(('testing %s' % test).center(80)) - term = subprocess.check_output([sys.executable, '-m', test], - stderr=subprocess.STDOUT) - print(term) - + + cmd = [sys.executable, '-m', test] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + for line in p.stdout: + print(line, end='') + p.wait() + if p.returncode: + raise Exception("%s returned: %d" % p.returncode) + return testresult