Ignore "not found" errors when removing orphaned registry keys

This commit is contained in:
Zanie Blue 2025-07-18 07:19:15 -05:00
parent 8f2f43c561
commit 96b28f0eaa
1 changed files with 5 additions and 1 deletions

View File

@ -282,7 +282,11 @@ pub fn remove_orphan_registry_entries(installations: &[ManagedPythonInstallation
debug!("Removing orphan registry key HKCU:\\{}", python_entry);
if let Err(err) = CURRENT_USER.remove_tree(&python_entry) {
// TODO(konsti): We don't have an installation key here.
warn_user_once!("Failed to remove orphan registry key HKCU:\\{python_entry}: {err}");
if err.code() != ERROR_NOT_FOUND {
warn_user_once!(
"Failed to remove orphan registry key HKCU:\\{python_entry}: {err}"
);
}
}
}
}