(
pex, # type: str
*additional_args, # type: str
**additional_env # type: Any
)
| 46 | |
| 47 | |
| 48 | def execute_sys_path_dump_pex( |
| 49 | pex, # type: str |
| 50 | *additional_args, # type: str |
| 51 | **additional_env # type: Any |
| 52 | ): |
| 53 | # type: (...) -> OrderedSet[str] |
| 54 | |
| 55 | interpreter = PythonInterpreter.get() |
| 56 | if PY2: |
| 57 | # Under Python 2 venvs (created by Pex via Virtualenv 16.7.12), the venv interpreter |
| 58 | # can fail to resolve stdlib weakref internals. We side-step by just resolving out |
| 59 | # of the venv since this test is aimed squarely at PYTHONPATH isolation. |
| 60 | interpreter = interpreter.resolve_base_interpreter() |
| 61 | |
| 62 | _, stdout, _ = interpreter.execute( |
| 63 | args=[pex] + list(additional_args), env=make_env(**additional_env) |
| 64 | ) |
| 65 | return OrderedSet(os.path.realpath(entry) for entry in cast("List[str]", json.loads(stdout))) |
| 66 | |
| 67 | |
| 68 | def read_additional_sys_path( |
no test coverage detected