def resolve_interpreter(exe):
<EOL>python_versions = get_installed_pythons()<EOL>if exe in python_versions:<EOL><INDENT>exe = python_versions[exe]<EOL><DEDENT>if os.path.abspath(exe) != exe:<EOL><INDENT>paths = os.environ.get('<STR_LIT>', '<STR_LIT>').split(os.pathsep)<EOL>for path in paths:<EOL><INDENT>if os.path.exists(os.path.join(path, exe)):<EOL><INDENT>exe = os.path.join(path, exe)<EOL>break<EOL><DEDENT><DEDENT><DEDENT>if not os.path.exists(exe):<EOL><INDENT>logger.fatal('<STR_LIT>' % (exe, exe))<EOL>raise SystemExit(<NUM_LIT:3>)<EOL><DEDENT>if not is_executable(exe):<EOL><INDENT>logger.fatal('<STR_LIT>' % (exe, exe))<EOL>raise SystemExit(<NUM_LIT:3>)<EOL><DEDENT>return exe<EOL>
If the executable given isn't an absolute path, search $PATH for the interpreter