diff options
author | Josh Gao <jmgao@google.com> | 2016-03-29 11:28:36 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2016-03-29 11:33:30 -0700 |
commit | 016c18c73d81d996e4dee553541847c467fbde6e (patch) | |
tree | 527cc4a1a2b61a01228bcdc755fbcb3efab28e2a /python-packages | |
parent | 5e26cab0508f349474c8c348646aa281e546780e (diff) | |
download | android_development-016c18c73d81d996e4dee553541847c467fbde6e.tar.gz android_development-016c18c73d81d996e4dee553541847c467fbde6e.tar.bz2 android_development-016c18c73d81d996e4dee553541847c467fbde6e.zip |
Fix adb.py.
oops
Change-Id: Id3e11ebc89d32f1d0a606047f9b69469fe701098
Diffstat (limited to 'python-packages')
-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 |