File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -1144,19 +1144,15 @@ def is_exe(fpath):
11441144 if is_exe (program ):
11451145 return program
11461146 else :
1147- for path in os .environ ["PATH" ].split (os .pathsep ):
1147+ exe_suffixes = ['' ]
1148+ if WINDOWS and '.' not in fname :
1149+ exe_suffixes = ['.exe' , '.cmd' , '.bat' ]
1150+ for path in os .environ ['PATH' ].split (os .pathsep ):
11481151 path = path .strip ('"' )
11491152 exe_file = os .path .join (path , program )
1150- if is_exe (exe_file ):
1151- return exe_file
1152-
1153- if WINDOWS and '.' not in fname :
1154- if is_exe (exe_file + '.exe' ):
1155- return exe_file + '.exe'
1156- if is_exe (exe_file + '.cmd' ):
1157- return exe_file + '.cmd'
1158- if is_exe (exe_file + '.bat' ):
1159- return exe_file + '.bat'
1153+ for ext in exe_suffixes :
1154+ if is_exe (exe_file + ext ):
1155+ return exe_file + ext
11601156
11611157 return None
11621158
You can’t perform that action at this time.
0 commit comments