From: Jordy Rose Date: Sat, 2 Jul 2011 17:28:55 +0000 (+0000) Subject: Use subprocess.Popen instead of popen2 to stop a deprecation warning when running... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2f494b6afc921369c4878ec54646b077e4a3e81e;p=oota-llvm.git Use subprocess.Popen instead of popen2 to stop a deprecation warning when running lit on OS X git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134324 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/lit/lit/Util.py b/utils/lit/lit/Util.py index 5635f50baef..226e453f285 100644 --- a/utils/lit/lit/Util.py +++ b/utils/lit/lit/Util.py @@ -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"])