This commit is contained in:
Kovid Goyal 2016-06-25 08:20:47 +05:30
parent 8365f503da
commit 389d00009b

View File

@ -88,10 +88,9 @@ def shorten_components_to(length, components, more_to_take=0, last_has_extension
def find_executable_in_path(name, path=None):
if path is None:
path = os.environ.get('PATH', '')
sep = ';' if iswindows else ':'
if iswindows and not name.endswith('.exe'):
name += '.exe'
path = path.split(sep)
path = path.split(os.pathsep)
for x in path:
q = os.path.abspath(os.path.join(x, name))
if os.access(q, os.X_OK):