Skip to content

Commit

Permalink
Merge pull request #949 from yodaldevoid/windows_store_detection
Browse files Browse the repository at this point in the history
Fix Windows Store install detection
  • Loading branch information
messense authored Jun 3, 2022
2 parents f3a735d + d922130 commit 05bda9e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/python_interpreter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ fn find_all_windows(target: &Target, min_python_minor: usize) -> Result<Vec<Stri
.unwrap();
let path = str::from_utf8(&output.stdout).unwrap().trim();
if !output.status.success() || path.trim().is_empty() {
bail!("Couldn't determine the path to python for `py {}`", version);
eprintln!(
"⚠️ Warning: couldn't determine the path to python for `py {}`",
version
);
continue;
}
interpreter.push(path.to_string());
versions_found.insert((major, minor));
Expand Down Expand Up @@ -230,7 +234,7 @@ fn find_all_windows(target: &Target, min_python_minor: usize) -> Result<Vec<Stri
// Fallback to pythonX.Y for Microsoft Store versions
for minor in min_python_minor..MAXIMUM_PYTHON_MINOR {
if !versions_found.contains(&(3, minor)) {
interpreter.push(format!("python3.{}", minor));
interpreter.push(format!("python3.{}.exe", minor));
versions_found.insert((3, minor));
}
}
Expand Down

0 comments on commit 05bda9e

Please sign in to comment.