mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Port some code to Python3
This commit is contained in:
parent
f73370088b
commit
a627dde0d0
24 changed files with 1439 additions and 2341 deletions
|
@ -65,11 +65,11 @@ impl<'a> phf_shared::PhfHash for Bytes<'a> {
|
|||
}
|
||||
|
||||
fn find_python() -> String {
|
||||
env::var("PYTHON2").ok().unwrap_or_else(|| {
|
||||
env::var("PYTHON3").ok().unwrap_or_else(|| {
|
||||
let candidates = if cfg!(windows) {
|
||||
["python2.7.exe", "python27.exe", "python.exe"]
|
||||
["python3.8.exe", "python38.exe", "python.exe"]
|
||||
} else {
|
||||
["python2.7", "python2", "python"]
|
||||
["python3.8", "python3", "python"]
|
||||
};
|
||||
for &name in &candidates {
|
||||
if Command::new(name)
|
||||
|
@ -82,7 +82,7 @@ fn find_python() -> String {
|
|||
}
|
||||
}
|
||||
panic!(
|
||||
"Can't find python (tried {})! Try fixing PATH or setting the PYTHON2 env var",
|
||||
"Can't find python (tried {})! Try fixing PATH or setting the PYTHON3 env var",
|
||||
candidates.join(", ")
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue