<s> from __future__ import absolute_import , division , print_function <EOL> import os <EOL> import sys <EOL> from os . path import isfile , join , expanduser <EOL> import conda . config as cc <EOL> from conda_build . config import config <EOL> def find_executable ( executable ) : <EOL> global dir_paths <EOL> if sys . platform == '<STR_LIT:win32>' : <EOL> dir_paths = [ join ( config . build_prefix , '<STR_LIT>' ) , <EOL> join ( config . build_prefix , '<STR_LIT>' ) , <EOL> join ( cc . root_dir , '<STR_LIT>' ) , <EOL> join ( cc . root_dir , '<STR_LIT>' ) , <EOL> ] <EOL> else : <EOL> dir_paths = [ join ( config . build_prefix , '<STR_LIT>' ) , <EOL> join ( cc . root_dir , '<STR_LIT>' ) , ] <EOL> dir_paths . extend ( os . environ [ '<STR_LIT>' ] . split ( os . pathsep ) ) <EOL> for dir_path in dir_paths : <EOL> if sys . platform == '<STR_LIT:win32>' : <EOL> for ext in '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' : <EOL> path = join ( dir_path , executable + ext ) <EOL> if isfile ( path ) : <EOL> return path <EOL> else : <EOL> path = join ( dir_path , executable ) <EOL> if isfile ( expanduser ( path ) ) : <EOL> return expanduser ( path ) <EOL> return None </s>
