1*8975f5c5SAndroid Build Coastguard Worker# Copyright 2012 The Chromium Authors 2*8975f5c5SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be 3*8975f5c5SAndroid Build Coastguard Worker# found in the LICENSE file. 4*8975f5c5SAndroid Build Coastguard Workerfrom __future__ import absolute_import 5*8975f5c5SAndroid Build Coastguard Worker 6*8975f5c5SAndroid Build Coastguard Workerimport os 7*8975f5c5SAndroid Build Coastguard Workerimport sys 8*8975f5c5SAndroid Build Coastguard Worker 9*8975f5c5SAndroid Build Coastguard Worker_CHROME_SRC = os.path.join( 10*8975f5c5SAndroid Build Coastguard Worker os.path.abspath(os.path.dirname(__file__)), '..', '..', '..') 11*8975f5c5SAndroid Build Coastguard Worker 12*8975f5c5SAndroid Build Coastguard Worker_PEXPECT_PATH = os.path.join(_CHROME_SRC, 'third_party', 'pexpect') 13*8975f5c5SAndroid Build Coastguard Workerif _PEXPECT_PATH not in sys.path: 14*8975f5c5SAndroid Build Coastguard Worker sys.path.append(_PEXPECT_PATH) 15*8975f5c5SAndroid Build Coastguard Worker 16*8975f5c5SAndroid Build Coastguard Worker# pexpect is not available on all platforms. We allow this file to be imported 17*8975f5c5SAndroid Build Coastguard Worker# on platforms without pexpect and only fail when pexpect is actually used. 18*8975f5c5SAndroid Build Coastguard Workertry: 19*8975f5c5SAndroid Build Coastguard Worker from pexpect import * # pylint: disable=W0401,W0614 20*8975f5c5SAndroid Build Coastguard Workerexcept ImportError: 21*8975f5c5SAndroid Build Coastguard Worker pass 22