Chromium Code Reviews| Index: testing/tools/common.py |
| diff --git a/testing/tools/common.py b/testing/tools/common.py |
| index 14745a8a3e62348254e111d9999a35eec3a0ceaf..d45404b4d4dd2a3f7d7094ab903002efa0d411e0 100755 |
| --- a/testing/tools/common.py |
| +++ b/testing/tools/common.py |
| @@ -4,6 +4,7 @@ |
| # found in the LICENSE file. |
| import os |
| +import subprocess |
| import sys |
| def os_name(): |
| @@ -16,6 +17,17 @@ def os_name(): |
| raise Exception('Confused, can not determine OS, aborting.') |
| +def RunCommand(cmd, redirect_output=False): |
| + try: |
| + if redirect_output: |
| + sys.stdout.write(subprocess.check_output(cmd, stderr=subprocess.STDOUT)) |
|
Nathan Parker
2015/10/09 19:55:04
Does the subprocess's stdout go to your modified s
Lei Zhang
2015/10/09 20:14:33
Yes, it seems to go to whatever sys.stdout is set
|
| + else: |
| + subprocess.check_call(cmd) |
| + return None |
| + except subprocess.CalledProcessError as e: |
| + return e |
| + |
| + |
| class DirectoryFinder: |
| '''A class for finding directories and paths under either a standalone |
| checkout or a chromium checkout of PDFium.''' |