mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
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:
parent
364e3999d4
commit
fa8db5a8d0
4 changed files with 61 additions and 2 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue