mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
[lit] Avoid deprecated dict.has_key() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187917 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
10251753b6
commit
f861516179
@ -6,7 +6,7 @@ def detectCPUs():
|
|||||||
"""
|
"""
|
||||||
# Linux, Unix and MacOS:
|
# Linux, Unix and MacOS:
|
||||||
if hasattr(os, "sysconf"):
|
if hasattr(os, "sysconf"):
|
||||||
if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"):
|
if "SC_NPROCESSORS_ONLN" in os.sysconf_names:
|
||||||
# Linux & Unix:
|
# Linux & Unix:
|
||||||
ncpus = os.sysconf("SC_NPROCESSORS_ONLN")
|
ncpus = os.sysconf("SC_NPROCESSORS_ONLN")
|
||||||
if isinstance(ncpus, int) and ncpus > 0:
|
if isinstance(ncpus, int) and ncpus > 0:
|
||||||
@ -14,7 +14,7 @@ def detectCPUs():
|
|||||||
else: # OSX:
|
else: # OSX:
|
||||||
return int(capture(['sysctl', '-n', 'hw.ncpu']))
|
return int(capture(['sysctl', '-n', 'hw.ncpu']))
|
||||||
# Windows:
|
# Windows:
|
||||||
if os.environ.has_key("NUMBER_OF_PROCESSORS"):
|
if "NUMBER_OF_PROCESSORS" in os.environ:
|
||||||
ncpus = int(os.environ["NUMBER_OF_PROCESSORS"])
|
ncpus = int(os.environ["NUMBER_OF_PROCESSORS"])
|
||||||
if ncpus > 0:
|
if ncpus > 0:
|
||||||
return ncpus
|
return ncpus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user