Skip to content

Commit

Permalink
Refactor interpreter selection at pex build time to pass CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Livingston committed Nov 16, 2017
1 parent 504f073 commit e5d52d6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pex/bin/pex.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from pex.base import maybe_requirement
from pex.common import die, safe_delete, safe_mkdir, safe_mkdtemp
from pex.crawler import Crawler
from pex.executor import Executor
from pex.fetcher import Fetcher, PyPIFetcher
from pex.http import Context
from pex.installer import EggInstaller
Expand Down Expand Up @@ -534,7 +535,12 @@ def build_pex(args, options, resolver_option_builder):
# NB: options.python and interpreter constraints cannot be used together, so this will not
# affect usages of the interpreter(s) specified by the "--python" command line flag
if ENV.PEX_PYTHON_PATH:
interpreters = PythonInterpreter.all(str(ENV.PEX_PYTHON_PATH).split(os.pathsep))
interpreters = []
for binary in ENV.PEX_PYTHON_PATH.split(os.pathsep):
try:
interpreters.append(PythonInterpreter.from_binary(binary))
except Executor.ExecutionError:
pass
else:
interpreters = PythonInterpreter.all()
constraints = options.interpreter_constraint
Expand Down

0 comments on commit e5d52d6

Please sign in to comment.