(
cls,
binary, # type: str
pyenv=None, # type: Optional[Pyenv]
cwd=None, # type: Optional[str]
)
| 1071 | |
| 1072 | @classmethod |
| 1073 | def _resolve_pyenv_shim( |
| 1074 | cls, |
| 1075 | binary, # type: str |
| 1076 | pyenv=None, # type: Optional[Pyenv] |
| 1077 | cwd=None, # type: Optional[str] |
| 1078 | ): |
| 1079 | # type: (...) -> Optional[str] |
| 1080 | |
| 1081 | pyenv = pyenv or cls._pyenv() |
| 1082 | if pyenv is not None: |
| 1083 | shim = pyenv.as_shim(binary) |
| 1084 | if shim is not None: |
| 1085 | python = shim.select_version(search_dir=cwd) |
| 1086 | if python is None: |
| 1087 | TRACER.log("Detected inactive pyenv shim: {}.".format(shim), V=3) |
| 1088 | else: |
| 1089 | TRACER.log("Detected pyenv shim activated to {}: {}.".format(python, shim), V=3) |
| 1090 | return python |
| 1091 | return binary |
| 1092 | |
| 1093 | @classmethod |
| 1094 | def _spawn_from_binary_external( |
no test coverage detected