glandium / git-cinnabar

git remote helper to interact with mercurial repositories
GNU General Public License v2.0
287 stars 60 forks source link

On Windows, try py.exe if other Python executables fail. #299

Closed jcsteh closed 2 years ago

jcsteh commented 2 years ago
  1. Windows ships with python.exe and python3.exe to start the Windows Store app, even if the Store app isn't installed. We work around that by checking whether the Python executable actually works, not just checking whether it exists.
  2. We still want to support users who explicitly put Python in the PATH, so we still try other Python executables first.
  3. The actual python.exe isn't guaranteed to be in the PATH, but the py.exe launcher usually is, so we try that as a last resort. If we do use py.exe, we should end up with the user's preferred Python. Fixes #298.