From 2f494b6afc921369c4878ec54646b077e4a3e81e Mon Sep 17 00:00:00 2001 From: Jordy Rose Date: Sat, 2 Jul 2011 17:28:55 +0000 Subject: [PATCH] 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 --- utils/lit/lit/Util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"]) -- 2.34.1