Update python detection in codegen (#31873)

* Update python detection in codegen

* Update build.rs
This commit is contained in:
Samson 2024-03-26 11:14:06 +01:00 committed by GitHub
parent f8a2eaea47
commit 58f170c97a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -67,9 +67,9 @@ impl<'a> phf_shared::PhfHash for Bytes<'a> {
fn find_python() -> String {
env::var("PYTHON3").ok().unwrap_or_else(|| {
let candidates = if cfg!(windows) {
["python3.8.exe", "python38.exe", "python.exe"]
["python.exe", "python"]
} else {
["python3.8", "python3", "python"]
["python3", "python"]
};
for &name in &candidates {
if Command::new(name)