Improve Python version check in installer script to handle errors gracefully

This commit is contained in:
Даниил Грабарь
2026-05-20 18:03:59 +03:00
parent e153de0bb7
commit c8b121958d
+5 -3
View File
@@ -155,10 +155,12 @@ install_uv() {
check_python() { check_python() {
log_info "Checking Python $PYTHON_VERSION..." log_info "Checking Python $PYTHON_VERSION..."
if "$UV_CMD" python find "$PYTHON_VERSION" </dev/null &>/dev/null; then local py_path
py_path="$("$UV_CMD" python find "$PYTHON_VERSION" </dev/null 2>/dev/null)" || true
if [ -n "$py_path" ]; then
local ver local ver
ver="$("$UV_CMD" python find "$PYTHON_VERSION" </dev/null | xargs -I{} {} --version 2>&1)" ver="$("$py_path" --version 2>&1)" || true
log_success "$ver found" log_success "${ver:-Python $PYTHON_VERSION} found"
return return
fi fi
log_info "Installing Python $PYTHON_VERSION via uv..." log_info "Installing Python $PYTHON_VERSION via uv..."