Skip to content
This repository was archived by the owner on Oct 20, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions bin/android_ndk_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,17 @@ def shell_command(self, command, error, **kwargs):
returncode = 0
else:
returncode = 1
# Regardless of the destination stream on the Android device ADB
# redirects everything to the standard error stream so this looks at the
# last line of the stream to get the command status code.
if out_lines:
try:
returncode = int(out_lines[-1])
out_lines = out_lines[:-1]
except ValueError:
pass

try:
returncode = int(err.splitlines()[-1])
except ValueError:
# legacy behavior: check last line of stdout (ADB used to merge STDOUT and STDERR)
if out_lines:
try:
returncode = int(out_lines[-1])
out_lines = out_lines[:-1]
except ValueError:
pass
if returncode and not kwargs.get('display_output'):
print out
print >> sys.stderr, err
Expand Down