mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
[lit] Avoid deprecated dict.has_key() method.
llvm-svn: 187917
This commit is contained in:
parent
0cff1be367
commit
fa196394e8
@ -6,7 +6,7 @@ def detectCPUs():
|
||||
"""
|
||||
# Linux, Unix and MacOS:
|
||||
if hasattr(os, "sysconf"):
|
||||
if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"):
|
||||
if "SC_NPROCESSORS_ONLN" in os.sysconf_names:
|
||||
# Linux & Unix:
|
||||
ncpus = os.sysconf("SC_NPROCESSORS_ONLN")
|
||||
if isinstance(ncpus, int) and ncpus > 0:
|
||||
@ -14,7 +14,7 @@ def detectCPUs():
|
||||
else: # OSX:
|
||||
return int(capture(['sysctl', '-n', 'hw.ncpu']))
|
||||
# Windows:
|
||||
if os.environ.has_key("NUMBER_OF_PROCESSORS"):
|
||||
if "NUMBER_OF_PROCESSORS" in os.environ:
|
||||
ncpus = int(os.environ["NUMBER_OF_PROCESSORS"])
|
||||
if ncpus > 0:
|
||||
return ncpus
|
||||
|
Loading…
Reference in New Issue
Block a user