We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
EXE_EXTENSION
1 parent 825f8ed commit 56dfb70Copy full SHA for 56dfb70
src/tools/x/src/main.rs
@@ -8,7 +8,8 @@
8
//! `x.py`, in that order of preference.
9
10
use std::{
11
- env, io,
+ env::{self, consts::EXE_EXTENSION},
12
+ io,
13
process::{self, Command, ExitStatus},
14
};
15
@@ -27,12 +28,12 @@ fn python() -> &'static str {
27
28
29
for dir in env::split_paths(&val) {
30
// `python` should always take precedence over python2 / python3 if it exists
- if dir.join(PYTHON).exists() {
31
+ if dir.join(PYTHON).with_extension(EXE_EXTENSION).exists() {
32
return PYTHON;
33
}
34
- python2 |= dir.join(PYTHON2).exists();
35
- python3 |= dir.join(PYTHON3).exists();
+ python2 |= dir.join(PYTHON2).with_extension(EXE_EXTENSION).exists();
36
+ python3 |= dir.join(PYTHON3).with_extension(EXE_EXTENSION).exists();
37
38
39
// try 3 before 2
0 commit comments