Treat empty UV_PYTHON_INSTALL_DIR as unset (#12907)

Same as https://github.com/astral-sh/uv/pull/12905 — found via regex
This commit is contained in:
Zanie Blue 2025-04-17 11:36:25 -05:00
parent cac6560b4f
commit 1988e209ef

View file

@ -120,7 +120,9 @@ impl ManagedPythonInstallations {
pub fn from_settings(install_dir: Option<PathBuf>) -> Result<Self, Error> {
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(