Avoid enumerating sources in errors for path Python requests (#13335)
e.g., these are misleading cruft in the error message at https://github.com/astral-sh/uv/pull/12168#discussion_r2078204601 ``` ❯ uv python find /foo/bar error: No interpreter found for path `/foo/bar` in virtual environments, managed installations, or search path ❯ cargo run -q -- python find /foo/bar error: No interpreter found at path `/foo/bar` ```
This commit is contained in:
@@ -2646,6 +2646,12 @@ impl fmt::Display for PythonNotFound {
|
||||
PythonRequest::Default | PythonRequest::Any => {
|
||||
write!(f, "No interpreter found in {sources}")
|
||||
}
|
||||
PythonRequest::File(_) => {
|
||||
write!(f, "No interpreter found at {}", self.request)
|
||||
}
|
||||
PythonRequest::Directory(_) => {
|
||||
write!(f, "No interpreter found in {}", self.request)
|
||||
}
|
||||
_ => {
|
||||
write!(f, "No interpreter found for {} in {sources}", self.request)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user