Utils: check_exe() to return an absolute path so it can be called

Because there cases where subprocess.Popen'ing the [result] can fail.
This commit is contained in:
Jérôme Carretero 2014-01-08 01:58:03 -05:00
parent 12b1212f4d
commit 0e7df22ad5
1 changed files with 2 additions and 2 deletions

View File

@ -471,13 +471,13 @@ def check_exe(name):
fpath, fname = os.path.split(name)
if fpath and is_exe(name):
return name
return os.path.abspath(name)
else:
for path in os.environ["PATH"].split(os.pathsep):
path = path.strip('"')
exe_file = os.path.join(path, name)
if is_exe(exe_file):
return exe_file
return os.path.abspath(exe_file)
return None
def def_attrs(cls, **kw):