FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-feedstock/recipe/win-find_exe.patch at python-debug · wheerd/python-feedstock · GitHub
wheerd
/
python-feedstock
Public
forked from
conda-forge/python-feedstock
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-feedstock
/
recipe
/
win-find_exe.patch
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (34 loc) · 1.08 KB
Breadcrumbs
python-feedstock
/
recipe
/
win-find_exe.patch
Copy path
File metadata and controls
35 lines (34 loc) · 1.08 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff --git Lib/distutils/spawn.py Lib/distutils/spawn.py
index 5dd415a..ce85901 100644
--- Lib/distutils/spawn.py
+++ Lib/distutils/spawn.py
@@ -176,17 +176,16 @@
def find_executable(executable, path=None):
path = os.environ['PATH']
paths = path.split(os.pathsep)
-
base, ext = os.path.splitext(executable)
-
-
if (sys.platform == 'win32') and (ext != '.exe'):
-
executable = executable + '.exe'
-
-
if not os.path.isfile(executable):
-
for p in paths:
-
f = os.path.join(p, executable)
-
if os.path.isfile(f):
-
# the file exists, we have a shot at spawn working
-
return f
-
return None
-
else:
-
return executable
+
+
for ext in '.exe', '.bat', '':
+
newexe = executable + ext
+
+
if os.path.isfile(newexe):
+
return newexe
+
else:
+
for p in paths:
+
f = os.path.join(p, newexe)
+
if os.path.isfile(f):
+
# the file exists, we have a shot at spawn working
+
return f
+
return None
Back
|
FazBrowse Home
|
New Git URL