This commit is contained in:
Mitchell Berendhuysen 2025-12-16 11:27:11 +01:00 committed by GitHub
commit 76cfd515fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -316,14 +316,18 @@ impl InstalledTools {
let environment_path = self.tool_dir(name);
// Remove any existing environment.
match fs_err::remove_dir_all(&environment_path) {
match remove_virtualenv(&environment_path) {
Ok(()) => {
debug!(
"Removed existing environment for tool `{name}`: {}",
environment_path.user_display()
);
}
Err(err) if err.kind() == io::ErrorKind::NotFound => (),
Err(uv_virtualenv::Error::Io(err)) => {
if err.kind() != io::ErrorKind::NotFound {
return Err(err.into());
}
}
Err(err) => return Err(err.into()),
}