def win_find_executable(executable, env):
 if os.path.dirname(executable):
  return executable
 path = env.get(u'PATH', u'')
 pathext = (env.get(u'PATHEXT') or u'.EXE')
 dirs = path.split(os.path.pathsep)
 (base, ext) = os.path.splitext(executable)
 if ext:
  extensions = [ext]
 else:
  extensions = pathext.split(os.path.pathsep)
 for directory in dirs:
  for extension in extensions:
   filepath = os.path.join(directory, (base + extension))
   if os.path.exists(filepath):
    return filepath
 return None

def win_find_executable ( executable , env ) : if os . path . dirname ( executable ) : return executable path = env . get ( u'PATH' , u'' ) pathext = ( env . get ( u'PATHEXT' ) or u'.EXE' ) dirs = path . split ( os . path . pathsep ) ( base , ext ) = os . path . splitext ( executable ) if ext : extensions = [ ext ] else : extensions = pathext . split ( os . path . pathsep ) for directory in dirs : for extension in extensions : filepath = os . path . join ( directory , ( base + extension ) ) if os . path . exists ( filepath ) : return filepath return None
explicetely looks for executable in env["path"] .