We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
which
1 parent 7b61f27 commit 7cafe37Copy full SHA for 7cafe37
1 file changed
emsdk.py
@@ -237,19 +237,16 @@ def is_exe(fpath):
237
if is_exe(program):
238
return program
239
else:
240
+ exe_suffixes = ['']
241
+ if WINDOWS and '.' not in fname:
242
+ exe_suffixes = ['.exe', '.cmd', '.bat']
243
+
244
for path in os.environ["PATH"].split(os.pathsep):
245
path = path.strip('"')
246
exe_file = os.path.join(path, program)
- if is_exe(exe_file):
- return exe_file
-
- if WINDOWS and '.' not in fname:
247
- if is_exe(exe_file + '.exe'):
248
- return exe_file + '.exe'
249
- if is_exe(exe_file + '.cmd'):
250
- return exe_file + '.cmd'
251
- if is_exe(exe_file + '.bat'):
252
- return exe_file + '.bat'
+ for ext in exe_suffixes:
+ if is_exe(exe_file + ext):
+ return exe_file + ext
253
254
return None
255
0 commit comments