[llvm] r187917 - [lit] Avoid deprecated dict.has_key() method.
Daniel Dunbar
daniel at zuster.org
Wed Aug 7 14:43:12 PDT 2013
Author: ddunbar
Date: Wed Aug 7 16:43:12 2013
New Revision: 187917
URL: http://llvm.org/viewvc/llvm-project?rev=187917&view=rev
Log:
[lit] Avoid deprecated dict.has_key() method.
Modified:
llvm/trunk/utils/lit/lit/Util.py
Modified: llvm/trunk/utils/lit/lit/Util.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/Util.py?rev=187917&r1=187916&r2=187917&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/Util.py (original)
+++ llvm/trunk/utils/lit/lit/Util.py Wed Aug 7 16:43:12 2013
@@ -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
More information about the llvm-commits
mailing list