Skip to content

Commit

Permalink
Improve error message when default Python is not found (#3770)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed May 22, 2024
1 parent 87b73ef commit a604355
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/uv-interpreter/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,11 +1193,11 @@ impl fmt::Display for InterpreterSource {
impl fmt::Display for InterpreterNotFound {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
match self {
Self::NoPythonInstallation(sources, Some(version)) => {
write!(f, "No Python {version} installation found in {sources}")
Self::NoPythonInstallation(sources, None | Some(VersionRequest::Default)) => {
write!(f, "No Python interpreters found in {sources}")
}
Self::NoPythonInstallation(sources, None) => {
write!(f, "No Python installation found in {sources}")
Self::NoPythonInstallation(sources, Some(version)) => {
write!(f, "No Python {version} interpreters found in {sources}")
}
Self::NoMatchingVersion(sources, VersionRequest::Default) => {
write!(f, "No Python interpreter found in {sources}")
Expand Down

0 comments on commit a604355

Please sign in to comment.