| Index: build/android/cmd_helper.py
|
| ===================================================================
|
| --- build/android/cmd_helper.py (revision 143267)
|
| +++ build/android/cmd_helper.py (working copy)
|
| @@ -1,12 +1,8 @@
|
| -#!/usr/bin/python
|
| -#
|
| -# Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +# Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| # Use of this source code is governed by a BSD-style license that can be
|
| # found in the LICENSE file.
|
|
|
| -"""A wrapper for subprocess to make calling shell commands easier."""
|
|
|
| -
|
| import logging
|
| import subprocess
|
|
|
| @@ -19,16 +15,13 @@
|
| the string or the first item in the args sequence.
|
| cwd: If not None, the subprocess's current directory will be changed to
|
| |cwd| before it's executed.
|
| -
|
| - Returns:
|
| - Return code from the command execution.
|
| """
|
| logging.info(str(args) + ' ' + (cwd or ''))
|
| p = subprocess.Popen(args=args, cwd=cwd)
|
| return p.wait()
|
|
|
|
|
| -def GetCmdOutput(args, cwd=None, shell=False):
|
| +def GetCmdOutput(args, cwd=None):
|
| """Open a subprocess to execute a program and returns its output.
|
|
|
| Args:
|
| @@ -36,15 +29,10 @@
|
| the string or the first item in the args sequence.
|
| cwd: If not None, the subprocess's current directory will be changed to
|
| |cwd| before it's executed.
|
| - shell: Whether to execute args as a shell command.
|
| -
|
| - Returns:
|
| - Captures and returns the command's stdout.
|
| - Prints the command's stderr to logger (which defaults to stdout).
|
| """
|
| logging.info(str(args) + ' ' + (cwd or ''))
|
| p = subprocess.Popen(args=args, cwd=cwd, stdout=subprocess.PIPE,
|
| - stderr=subprocess.PIPE, shell=shell)
|
| + stderr=subprocess.PIPE)
|
| stdout, stderr = p.communicate()
|
| if stderr:
|
| logging.critical(stderr)
|
|
|