Skip to content

Commit

Permalink
Do not error when the Python bin directory is missing on `uv python u…
Browse files Browse the repository at this point in the history
…ninstall` (astral-sh#8725)
  • Loading branch information
zanieb authored Oct 31, 2024
1 parent ad896c8 commit b52f229
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion crates/uv/src/commands/python/uninstall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ async fn do_uninstall(

// Collect files in a directory
let executables = python_executable_dir()?
.read_dir()?
.read_dir()
.into_iter()
.flatten()
.filter_map(|entry| match entry {
Ok(entry) => Some(entry),
Err(err) => {
Expand Down
7 changes: 4 additions & 3 deletions crates/uv/tests/it/python_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ fn python_install() {
"###);

uv_snapshot!(context.filters(), context.python_uninstall().arg("3.13"), @r###"
success: false
exit_code: 2
success: true
exit_code: 0
----- stdout -----
----- stderr -----
Searching for Python versions matching: Python 3.13
error: No such file or directory (os error 2)
Uninstalled Python 3.13.0 in [TIME]
- cpython-3.13.0-[PLATFORM]
"###);
}

Expand Down

0 comments on commit b52f229

Please sign in to comment.