Chromium Code Reviews| Index: build/android/pylib/device/adb_wrapper.py |
| diff --git a/build/android/pylib/device/adb_wrapper.py b/build/android/pylib/device/adb_wrapper.py |
| index f4a5931121acc5db030fea1b8e2bbf9bbf8b3271..e623116075ff3869e82d295e103d3fbb0efe8407 100644 |
| --- a/build/android/pylib/device/adb_wrapper.py |
| +++ b/build/android/pylib/device/adb_wrapper.py |
| @@ -171,18 +171,16 @@ class AdbWrapper(object): |
| if expect_rc is None: |
| actual_command = command |
| else: |
| - actual_command = '%s; echo $?;' % command |
| + actual_command = '%s; echo $?;' % command.rstrip() |
|
perezju
2014/10/20 15:37:10
This is the fix.
|
| output = self._DeviceAdbCmd( |
| ['shell', actual_command], timeout, retries, check_error=False) |
| if expect_rc is not None: |
| output_end = output.rstrip().rfind('\n') + 1 |
| - rc = output[output_end:].strip() |
| + rc = int(output[output_end:].strip()) |
|
jbudorick
2014/10/20 15:40:59
I think we should catch ValueError here and raise
|
| output = output[:output_end] |
| - if int(rc) != expect_rc: |
| - raise device_errors.AdbCommandFailedError( |
| - ['shell', command], |
| - 'shell command exited with code: %s' % rc, |
| - self._device_serial) |
| + if rc != expect_rc: |
| + raise device_errors.AdbShellCommandFailedError( |
| + command, rc, output, self._device_serial) |
| return output |
| def Logcat(self, filter_spec=None, timeout=_DEFAULT_TIMEOUT, |