Use os.system instead of Popen, since it doesn't need the full path on unix.

This commit is contained in:
Nick Bolton 2010-09-07 20:52:51 +00:00
parent 1d8f1b6b13
commit 3d21f93dd3
1 changed files with 2 additions and 8 deletions

View File

@ -183,15 +183,9 @@ class InternalCommands:
def persist_cmake(self):
# even though we're running `cmake --version`, we're only doing this for the 0 return
# code; we don't care about the version, since CMakeLists worrys about this for us.
p = subprocess.Popen(
[self.cmake_cmd, '--version'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
err = os.system('%s --version' % self.cmake_cmd)
stdout, stderr = p.communicate()
if p.returncode != 0:
if err != 0:
# if return code from cmake is not 0, then either something has
# gone terribly wrong with --version, or it genuinely doesn't exist.
print ('Could not find `%s` in system path.\n'