fix(installer): Avoid misleading error message when searching for python binary

which prints a message to stderr when it doesn't find anything. In this case,
not finding anything is expected so the error is misleading.
This commit is contained in:
Maximilian Maag 2024-10-18 19:05:07 +02:00 committed by Eugene Brodsky
parent 5440c03767
commit 2430137d19

View File

@ -12,7 +12,7 @@ MINIMUM_PYTHON_VERSION=3.10.0
MAXIMUM_PYTHON_VERSION=3.11.100
PYTHON=""
for candidate in python3.11 python3.10 python3 python ; do
if ppath=`which $candidate`; then
if ppath=`which $candidate 2>/dev/null`; then
# when using `pyenv`, the executable for an inactive Python version will exist but will not be operational
# we check that this found executable can actually run
if [ $($candidate --version &>/dev/null; echo ${PIPESTATUS}) -gt 0 ]; then continue; fi