()
| 107 | |
| 108 | @functools.lru_cache(maxsize=1) |
| 109 | def get_default_version() -> str: # pragma: no cover (platform dependent) |
| 110 | v_major = f'{sys.version_info[0]}' |
| 111 | v_minor = f'{sys.version_info[0]}.{sys.version_info[1]}' |
| 112 | |
| 113 | # attempt the likely implementation exe |
| 114 | for potential in (v_minor, v_major): |
| 115 | exe = f'{_impl_exe_name()}{potential}' |
| 116 | if find_executable(exe): |
| 117 | return exe |
| 118 | |
| 119 | # next try `sys.executable` (or the realpath) |
| 120 | maybe_exe = _find_by_sys_executable() |
| 121 | if maybe_exe: |
| 122 | return maybe_exe |
| 123 | |
| 124 | # maybe on windows we can find it via py launcher? |
| 125 | if sys.platform == 'win32': # pragma: win32 cover |
| 126 | exe = f'python{v_minor}' |
| 127 | if _find_by_py_launcher(exe): |
| 128 | return exe |
| 129 | |
| 130 | # We tried! |
| 131 | return C.DEFAULT |
| 132 | |
| 133 | |
| 134 | def _sys_executable_matches(version: str) -> bool: |
nothing calls this directly
no test coverage detected