--- spawn_old.py 2008-09-03 17:53:36 +0000 +++ spawn.py 2008-09-03 17:06:36 +0000 @@ -185,17 +185,23 @@ if path is None: path = os.environ['PATH'] paths = string.split(path, os.pathsep) - (base, ext) = os.path.splitext(executable) - if (sys.platform == 'win32' or os.name == 'os2') 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 + extlist = [''] + if os.name == 'os2' or sys.platform == 'win32': + pathext = os.environ['PATHEXT'].split(os.pathsep) + (base, ext) = os.path.splitext(executable) + if ext not in pathext: + extlist = pathext + for ext in extlist: + execname = executable + ext + if os.path.isfile(execname): + return execname + else: + for p in paths: + f = os.path.join(p, execname) + if os.path.isfile(f): + # the file exists, we have a shot at spawn working + return f else: - return executable + return None # find_executable()