Processor detection improvement

This commit is contained in:
ita 2011-09-30 16:45:11 +02:00
parent a971973cde
commit a29880d753
1 changed files with 1 additions and 1 deletions

View File

@ -169,7 +169,7 @@ class OptionsContext(Context.Context):
count = int(os.sysconf('SC_NPROCESSORS_ONLN'))
elif 'SC_NPROCESSORS_CONF' in os.sysconf_names:
count = int(os.sysconf('SC_NPROCESSORS_CONF'))
elif os.name not in ('nt', 'java'):
if not count and os.name not in ('nt', 'java'):
tmp = self.cmd_and_log(['sysctl', '-n', 'hw.ncpu'])
if re.match('^[0-9]+$', tmp):
count = int(tmp)