Use subprocess.Popen instead of popen2 to stop a deprecation warning when running lit on OS X

llvm-svn: 134324
This commit is contained in:
Jordy Rose 2011-07-02 17:28:55 +00:00
parent 4bea037504
commit 1c32720248
1 changed files with 1 additions and 1 deletions
llvm/utils/lit/lit

View File

@ -12,7 +12,7 @@ def detectCPUs():
if isinstance(ncpus, int) and ncpus > 0:
return ncpus
else: # OSX:
return int(os.popen2("sysctl -n hw.ncpu")[1].read())
return int(capture(['sysctl', '-n', 'hw.ncpu']))
# Windows:
if os.environ.has_key("NUMBER_OF_PROCESSORS"):
ncpus = int(os.environ["NUMBER_OF_PROCESSORS"])