From af9c2e60aabcb13cebecbbb173238215852ec7f2 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Sat, 29 Jun 2024 00:39:26 -0400 Subject: [PATCH] Ignore `py` not found errors during interpreter discovery (#4620) Closes https://github.com/astral-sh/uv/issues/4522 --- crates/uv-toolchain/src/discovery.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/uv-toolchain/src/discovery.rs b/crates/uv-toolchain/src/discovery.rs index cfd3171df..a86122072 100644 --- a/crates/uv-toolchain/src/discovery.rs +++ b/crates/uv-toolchain/src/discovery.rs @@ -19,7 +19,7 @@ use crate::downloads::PythonDownloadRequest; use crate::implementation::{ImplementationName, LenientImplementationName}; use crate::interpreter::Error as InterpreterError; use crate::managed::InstalledToolchains; -use crate::py_launcher::py_list_paths; +use crate::py_launcher::{self, py_list_paths}; use crate::toolchain::Toolchain; use crate::virtualenv::{ conda_prefix_from_env, virtualenv_from_env, virtualenv_from_working_dir, @@ -538,6 +538,11 @@ impl Error { false } }, + // Ignore `py` if it's not installed + Error::PyLauncher(py_launcher::Error::NotFound) => { + debug!("The `py` launcher could not be found to query for Python versions"); + false + } _ => true, } }