SR
Size: a a a
SR
VB
AR
fn find_python() -> String {
env::var("PYTHON3").ok().unwrap_or_else(|| {
let candidates = if cfg!(windows) {
["python3.8.exe", "python38.exe", "python.exe"]
} else {
["python3.8", "python3", "python"]
};
for &name in &candidates {
if Command::new(name)
.arg("--version")
.output()
.ok()
.map_or(false, |out| out.status.success())
{
return name.to_owned();
}
}
panic!(
"Can't find python (tried {})! Try fixing PATH or setting the PYTHON3 env var",
candidates.join(", ")
)
})
}
AR
VB
AR
SR
T
VB
VB
T
VB
T
A
A
SR
SR
SR
SR
K