diff --git a/crates/uv-virtualenv/src/virtualenv.rs b/crates/uv-virtualenv/src/virtualenv.rs index 85438c734..e3412992b 100644 --- a/crates/uv-virtualenv/src/virtualenv.rs +++ b/crates/uv-virtualenv/src/virtualenv.rs @@ -655,6 +655,12 @@ fn copy_launcher_windows( /// /// See: fn find_base_python(executable: &Path, major: u8, minor: u8) -> Result { + /// Returns `true` if `path` is the root directory. + fn is_root(path: &Path) -> bool { + let mut components = path.components(); + components.next() == Some(std::path::Component::RootDir) && components.next().is_none() + } + /// Determining whether `dir` is a valid Python prefix by searching for a "landmark". /// /// See: @@ -678,7 +684,7 @@ fn find_base_python(executable: &Path, major: u8, minor: u8) -> Result