(
version: str,
)
| 62 | |
| 63 | |
| 64 | def _find_by_py_launcher( |
| 65 | version: str, |
| 66 | ) -> str | None: # pragma: no cover (windows only) |
| 67 | if version.startswith('python'): |
| 68 | num = version.removeprefix('python') |
| 69 | cmd = ('py', f'-{num}', '-c', 'import sys; print(sys.executable)') |
| 70 | env = dict(os.environ, PYTHONIOENCODING='UTF-8') |
| 71 | try: |
| 72 | return cmd_output(*cmd, env=env)[1].strip() |
| 73 | except CalledProcessError: |
| 74 | pass |
| 75 | return None |
| 76 | |
| 77 | |
| 78 | def _impl_exe_name() -> str: |
no test coverage detected