Skip to content

Commit b52f229

Browse files
authored
Do not error when the Python bin directory is missing on uv python uninstall (#8725)
1 parent ad896c8 commit b52f229

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

crates/uv/src/commands/python/uninstall.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ async fn do_uninstall(
126126

127127
// Collect files in a directory
128128
let executables = python_executable_dir()?
129-
.read_dir()?
129+
.read_dir()
130+
.into_iter()
131+
.flatten()
130132
.filter_map(|entry| match entry {
131133
Ok(entry) => Some(entry),
132134
Err(err) => {

crates/uv/tests/it/python_install.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@ fn python_install() {
7474
"###);
7575

7676
uv_snapshot!(context.filters(), context.python_uninstall().arg("3.13"), @r###"
77-
success: false
78-
exit_code: 2
77+
success: true
78+
exit_code: 0
7979
----- stdout -----
8080
8181
----- stderr -----
8282
Searching for Python versions matching: Python 3.13
83-
error: No such file or directory (os error 2)
83+
Uninstalled Python 3.13.0 in [TIME]
84+
- cpython-3.13.0-[PLATFORM]
8485
"###);
8586
}
8687

0 commit comments

Comments
 (0)