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

Side by Side Diff: build/android/pylib/android_commands.py

Issue 11275007: Wrap "import pexpect" in a try-expect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Provides an interface to communicate with the device via the adb command. 5 """Provides an interface to communicate with the device via the adb command.
6 6
7 Assumes adb binary is currently on system path. 7 Assumes adb binary is currently on system path.
8 """ 8 """
9 9
10 import collections 10 import collections
11 import datetime 11 import datetime
12 import logging 12 import logging
13 import os 13 import os
14 import re 14 import re
15 import shlex 15 import shlex
16 import subprocess 16 import subprocess
17 import sys 17 import sys
18 import tempfile 18 import tempfile
19 import time 19 import time
20 20
21 import io_stats_parser 21 import io_stats_parser
22 import pexpect 22 try:
23 import pexpect
24 except:
25 pexpect = None
23 26
24 CHROME_SRC = os.path.join( 27 CHROME_SRC = os.path.join(
25 os.path.abspath(os.path.dirname(__file__)), '..', '..', '..') 28 os.path.abspath(os.path.dirname(__file__)), '..', '..', '..')
26 29
27 sys.path.append(os.path.join(CHROME_SRC, 'third_party', 'android_testrunner')) 30 sys.path.append(os.path.join(CHROME_SRC, 'third_party', 'android_testrunner'))
28 import adb_interface 31 import adb_interface
29 32
30 import cmd_helper 33 import cmd_helper
31 import errors # is under ../../../third_party/android_testrunner/errors.py 34 import errors # is under ../../../third_party/android_testrunner/errors.py
32 35
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 def __init__(self, output): 1064 def __init__(self, output):
1062 self._output = output 1065 self._output = output
1063 1066
1064 def write(self, data): 1067 def write(self, data):
1065 data = data.replace('\r\r\n', '\n') 1068 data = data.replace('\r\r\n', '\n')
1066 self._output.write(data) 1069 self._output.write(data)
1067 1070
1068 def flush(self): 1071 def flush(self):
1069 self._output.flush() 1072 self._output.flush()
1070 1073
OLDNEW
« 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