diff options
author | Josh Gao <jmgao@google.com> | 2016-03-29 18:36:51 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-03-29 18:36:51 +0000 |
commit | efd181bf4cae5d6979ece2c0ab04ad315d8e4629 (patch) | |
tree | e763e1c03c5553fafcd9f2b255a54635111e9eb8 | |
parent | e950121692bb4ebe23252cad41f19403c7b47e08 (diff) | |
parent | d101c56ac6714edb403d44ac2cf1e5d8c794d3d1 (diff) | |
download | development-ndk-r11-release.tar.gz |
Merge "Fix adb.py." into ndk-r11-releasendk-r11cndk-r11-release
-rw-r--r-- | python-packages/adb/device.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/python-packages/adb/device.py b/python-packages/adb/device.py index a7d281223..64ba43b85 100644 --- a/python-packages/adb/device.py +++ b/python-packages/adb/device.py @@ -228,10 +228,11 @@ def split_lines(s): return re.split(r'[\r\n]+', s.rstrip()) -def version(adb_path='adb'): +def version(adb_path=None): """Get the version of adb (in terms of ADB_SERVER_VERSION).""" - version_output = subprocess.check_output([adb_path, 'version']) + adb_path = adb_path if adb_path is not None else ['adb'] + version_output = subprocess.check_output(adb_path + ['version']) pattern = r'^Android Debug Bridge version 1.0.(\d+)$' result = re.match(pattern, version_output.splitlines()[0]) if not result: @@ -289,7 +290,7 @@ class AndroidDevice(object): def _make_shell_cmd(self, user_cmd): command = self.adb_cmd + ['shell'] + user_cmd - if self.has_shell_protocol(): + if not self.has_shell_protocol(): command += self._RETURN_CODE_PROBE return command |