summaryrefslogtreecommitdiff
path: root/src/python/m5/params.py
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2019-01-25 12:12:38 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2019-02-12 17:36:12 +0000
commit5cd4248672e5cd62cfec4753bd6d6ce666694f1f (patch)
tree7b0379ee8f0ff44a76895ff50922becda6a16d40 /src/python/m5/params.py
parent5cf312eb5bec50ab2142ce4c7df05d673cd9a716 (diff)
downloadgem5-5cd4248672e5cd62cfec4753bd6d6ce666694f1f.tar.xz
python: Replace dict.has_key with 'key in dict'
Python 3 has removed dict.has_key in favour of 'key in dict'. Change-Id: I9852a5f57d672bea815308eb647a0ce45624fad5 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/15987 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Diffstat (limited to 'src/python/m5/params.py')
-rw-r--r--src/python/m5/params.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/python/m5/params.py b/src/python/m5/params.py
index 0a563b8f2..09aaa5af7 100644
--- a/src/python/m5/params.py
+++ b/src/python/m5/params.py
@@ -157,12 +157,12 @@ class ParamDesc(object):
else:
raise TypeError('too many arguments')
- if kwargs.has_key('desc'):
+ if 'desc' in kwargs:
assert(not hasattr(self, 'desc'))
self.desc = kwargs['desc']
del kwargs['desc']
- if kwargs.has_key('default'):
+ if 'default' in kwargs:
assert(not hasattr(self, 'default'))
self.default = kwargs['default']
del kwargs['default']
@@ -1224,14 +1224,14 @@ class MetaEnum(MetaParamValue):
return cls
def __init__(cls, name, bases, init_dict):
- if init_dict.has_key('map'):
+ if 'map' in init_dict:
if not isinstance(cls.map, dict):
raise TypeError("Enum-derived class attribute 'map' " \
"must be of type dict")
# build list of value strings from map
cls.vals = cls.map.keys()
cls.vals.sort()
- elif init_dict.has_key('vals'):
+ elif 'vals' in init_dict:
if not isinstance(cls.vals, list):
raise TypeError("Enum-derived class attribute 'vals' " \
"must be of type list")
@@ -1855,7 +1855,7 @@ class PortRef(object):
"cannot splice in new peers\n", self)
def clone(self, simobj, memo):
- if memo.has_key(self):
+ if self in memo:
return memo[self]
newRef = copy.copy(self)
memo[self] = newRef
@@ -1978,7 +1978,7 @@ class VectorPortRef(object):
self._get_next().connect(other)
def clone(self, simobj, memo):
- if memo.has_key(self):
+ if self in memo:
return memo[self]
newRef = copy.copy(self)
memo[self] = newRef