Skip to content

Commit

Permalink
Further hide _PEX_EXEC_CHAIN from production.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Jun 25, 2019
1 parent 1ece89c commit 4efafc2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pex/pex_bootstrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ def maybe_reexec_pex(compatibility_constraints=None):

current_interpreter = PythonInterpreter.get()

# NB: Used only for debugging and tests.
pex_exec_chain = []
# NB: Used only for tests.
if '_PEX_EXEC_CHAIN' in os.environ:
pex_exec_chain.extend(os.environ['_PEX_EXEC_CHAIN'].split(os.pathsep))
pex_exec_chain.append(current_interpreter.binary)
os.environ['_PEX_EXEC_CHAIN'] = os.pathsep.join(pex_exec_chain)
flag_or_chain = os.environ.pop('_PEX_EXEC_CHAIN')
pex_exec_chain = [] if flag_or_chain == '1' else flag_or_chain.split(os.pathsep)
pex_exec_chain.append(current_interpreter.binary)
os.environ['_PEX_EXEC_CHAIN'] = os.pathsep.join(pex_exec_chain)

current_interpreter_blessed_env_var = '_PEX_SHOULD_EXIT_BOOTSTRAP_REEXEC'
if os.environ.pop(current_interpreter_blessed_env_var, None):
Expand Down
3 changes: 2 additions & 1 deletion tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,8 @@ def add_to_path(entry):
result = run_pex_command(args, env=env)
result.assert_success()

env = make_env(PEX_INTERPRETER=1,
env = make_env(_PEX_EXEC_CHAIN=1,
PEX_INTERPRETER=1,
PEX_PYTHON=pex_python,
PEX_PYTHON_PATH=os.pathsep.join(pex_python_path) if pex_python_path else None)

Expand Down

0 comments on commit 4efafc2

Please sign in to comment.