Skip to content

Commit 574aa1e

Browse files
authored
Better error reporting for removing Python versions from the Windows registry (astral-sh#14722)
See https://github.com/astral-sh/uv/actions/runs/16370666070/job/46258004849 We didn't actual use a format string, showing the template instead. We don't show the causes in the error report, so we format it into one error.
1 parent a186fda commit 574aa1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/uv-python/src/windows_registry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use crate::managed::ManagedPythonInstallation;
44
use crate::platform::Arch;
55
use crate::{COMPANY_DISPLAY_NAME, COMPANY_KEY, PythonInstallationKey, PythonVersion};
6+
use anyhow::anyhow;
67
use std::cmp::Ordering;
78
use std::collections::HashSet;
89
use std::path::PathBuf;
@@ -238,8 +239,7 @@ pub fn remove_registry_entry<'a>(
238239
} else {
239240
errors.push((
240241
installation.key().clone(),
241-
anyhow::Error::new(err)
242-
.context("Failed to clear registry entries under HKCU:\\{python_entry}"),
242+
anyhow!("Failed to clear registry entries under HKCU:\\{python_entry}: {err}"),
243243
));
244244
}
245245
}

0 commit comments

Comments
 (0)