| Index: build/android/pylib/cmd_helper.py
|
| diff --git a/build/android/pylib/cmd_helper.py b/build/android/pylib/cmd_helper.py
|
| index ab9105411c784b31a9d2e72e4b91648689035057..aba00be735368e9e931e321b14bef1d46ad1fbf3 100644
|
| --- a/build/android/pylib/cmd_helper.py
|
| +++ b/build/android/pylib/cmd_helper.py
|
| @@ -9,7 +9,6 @@
|
| import pipes
|
| import select
|
| import signal
|
| -import string
|
| import StringIO
|
| import subprocess
|
| import time
|
| @@ -19,52 +18,6 @@
|
| import fcntl
|
| except ImportError:
|
| fcntl = None
|
| -
|
| -_SafeShellChars = frozenset(string.ascii_letters + string.digits + '@%_-+=:,./')
|
| -
|
| -def SingleQuote(s):
|
| - """Return an shell-escaped version of the string using single quotes.
|
| -
|
| - Reliably quote a string which may contain unsafe characters (e.g. space,
|
| - quote, or other special characters such as '$').
|
| -
|
| - The returned value can be used in a shell command line as one token that gets
|
| - to be interpreted literally.
|
| -
|
| - Args:
|
| - s: The string to quote.
|
| -
|
| - Return:
|
| - The string quoted using single quotes.
|
| - """
|
| - return pipes.quote(s)
|
| -
|
| -def DoubleQuote(s):
|
| - """Return an shell-escaped version of the string using double quotes.
|
| -
|
| - Reliably quote a string which may contain unsafe characters (e.g. space
|
| - or quote characters), while retaining some shell features such as variable
|
| - interpolation.
|
| -
|
| - The returned value can be used in a shell command line as one token that gets
|
| - to be further interpreted by the shell.
|
| -
|
| - The set of characters that retain their special meaning may depend on the
|
| - shell implementation. This set usually includes: '$', '`', '\', '!', '*',
|
| - and '@'.
|
| -
|
| - Args:
|
| - s: The string to quote.
|
| -
|
| - Return:
|
| - The string quoted using double quotes.
|
| - """
|
| - if not s:
|
| - return '""'
|
| - elif all(c in _SafeShellChars for c in s):
|
| - return s
|
| - else:
|
| - return '"' + s.replace('"', '\\"') + '"'
|
|
|
|
|
| def Popen(args, stdout=None, stderr=None, shell=None, cwd=None, env=None):
|
| @@ -135,7 +88,7 @@
|
| elif shell:
|
| raise Exception('array args must be run with shell=False')
|
| else:
|
| - args_repr = ' '.join(map(SingleQuote, args))
|
| + args_repr = ' '.join(map(pipes.quote, args))
|
|
|
| s = '[host]'
|
| if cwd:
|
|
|