From 1988e209eff1ecd78af2b2ef35c262c5db7d30ca Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 17 Apr 2025 11:36:25 -0500 Subject: [PATCH] Treat empty `UV_PYTHON_INSTALL_DIR` as unset (#12907) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same as https://github.com/astral-sh/uv/pull/12905 — found via regex --- crates/uv-python/src/managed.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/uv-python/src/managed.rs b/crates/uv-python/src/managed.rs index 343c4ad74..309b941b5 100644 --- a/crates/uv-python/src/managed.rs +++ b/crates/uv-python/src/managed.rs @@ -120,7 +120,9 @@ impl ManagedPythonInstallations { pub fn from_settings(install_dir: Option) -> Result { if let Some(install_dir) = install_dir { Ok(Self::from_path(install_dir)) - } else if let Some(install_dir) = std::env::var_os(EnvVars::UV_PYTHON_INSTALL_DIR) { + } else if let Some(install_dir) = + std::env::var_os(EnvVars::UV_PYTHON_INSTALL_DIR).filter(|s| !s.is_empty()) + { Ok(Self::from_path(install_dir)) } else { Ok(Self::from_path(