Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3432)

Unified Diff: build/android/pylib/__init__.py

Issue 15804004: Windows perf bots: fixes android pylib initialization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/__init__.py
diff --git a/build/android/pylib/__init__.py b/build/android/pylib/__init__.py
index ba6323e985981379c71c2e90295ea96e0f4c18c1..c68adccbd36d9a6f1ebed3140163ab24e2522e00 100644
--- a/build/android/pylib/__init__.py
+++ b/build/android/pylib/__init__.py
@@ -4,14 +4,16 @@
import os
import subprocess
+import sys
-if not os.environ.get('ANDROID_SDK_ROOT'):
+if sys.platform == 'linux2' and not os.environ.get('ANDROID_SDK_ROOT'):
# If envsetup.sh hasn't been sourced and there's no adb in the path,
# set it here.
- with file(os.devnull, 'w') as devnull:
- ret = subprocess.call(['which', 'adb'], stdout=devnull, stderr=devnull)
- if ret:
+ try:
+ with file(os.devnull, 'w') as devnull:
+ subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull)
+ except OSError:
print 'No adb found in $PATH, fallback to checked in binary.'
os.environ['PATH'] += os.pathsep + os.path.abspath(os.path.join(
os.path.dirname(__file__),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698