forked from OSchip/llvm-project
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:
parent
4bea037504
commit
1c32720248
|
@ -12,7 +12,7 @@ def detectCPUs():
|
||||||
if isinstance(ncpus, int) and ncpus > 0:
|
if isinstance(ncpus, int) and ncpus > 0:
|
||||||
return ncpus
|
return ncpus
|
||||||
else: # OSX:
|
else: # OSX:
|
||||||
return int(os.popen2("sysctl -n hw.ncpu")[1].read())
|
return int(capture(['sysctl', '-n', 'hw.ncpu']))
|
||||||
# Windows:
|
# Windows:
|
||||||
if os.environ.has_key("NUMBER_OF_PROCESSORS"):
|
if os.environ.has_key("NUMBER_OF_PROCESSORS"):
|
||||||
ncpus = int(os.environ["NUMBER_OF_PROCESSORS"])
|
ncpus = int(os.environ["NUMBER_OF_PROCESSORS"])
|
||||||
|
|
Loading…
Reference in New Issue