Improve error message when default Python is not found (#3770)

This commit is contained in:
Zanie Blue 2024-05-22 17:28:52 -04:00 committed by GitHub
parent 87b73ef7a9
commit a6043553c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -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}")