Fix python not being resolved correctly if not in path (#4864)

* Don't replace plugin exec path if python command. Don't clobber exec
* Fix logging of python resolve errors
This commit is contained in:
WithoutPants
2024-05-22 14:57:36 +10:00
committed by GitHub
parent 062d566195
commit 865208844c
2 changed files with 8 additions and 5 deletions

View File

@@ -35,7 +35,7 @@ func Resolve(configuredPythonPath string) (*Python, error) {
case err == nil && !isFile:
logger.Warnf("configured python path is not a file: %s", configuredPythonPath)
case err != nil:
logger.Warnf("unable to use configured python path: %s", err)
logger.Warnf("unable to use configured python path: %v", err)
}
}
@@ -44,7 +44,7 @@ func Resolve(configuredPythonPath string) (*Python, error) {
if err != nil {
python, err := exec.LookPath("python")
if err != nil {
return nil, fmt.Errorf("python executable not in PATH: %s", err)
return nil, fmt.Errorf("python executable not in PATH: %w", err)
}
ret := Python(python)
return &ret, nil