summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn J. Goff <shawn.goff@accelecon.com>2012-12-17 16:29:16 -0500
committerDan Williams <dcbw@redhat.com>2012-12-17 16:59:48 -0600
commit2a9bb58bd284d228a349b918d5f352cdffc8a1ad (patch)
tree5d514535f73b30ea5eed19355975fa65198723eb
parent31e3155c414d8d4c7e3ec5d9f0d75d37c6ee1c79 (diff)
qmi-codegen python3: fix dict.has_key('key') to 'key' in dict
Python 3 no longer supports the has_key() method. sed regex: s/\([^ ]\+\)\.has_key(\([^)]*\))/\2 in \1/g
-rw-r--r--build-aux/qmi-codegen/Variable.py2
-rwxr-xr-xutils/qmidb/Fields.py2
-rwxr-xr-xutils/qmidb/Structs.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/build-aux/qmi-codegen/Variable.py b/build-aux/qmi-codegen/Variable.py
index 8e4bfc6..c238471 100644
--- a/build-aux/qmi-codegen/Variable.py
+++ b/build-aux/qmi-codegen/Variable.py
@@ -45,7 +45,7 @@ class Variable:
self.needs_dispose = False
self.endian = "QMI_ENDIAN_LITTLE"
- if dictionary.has_key('endian'):
+ if 'endian' in dictionary:
endian = dictionary['endian']
if endian == 'network' or endian == 'big':
self.endian = "QMI_ENDIAN_BIG"
diff --git a/utils/qmidb/Fields.py b/utils/qmidb/Fields.py
index 9df70a2..cd2e86b 100755
--- a/utils/qmidb/Fields.py
+++ b/utils/qmidb/Fields.py
@@ -151,7 +151,7 @@ class Fields:
self.byid[field.id] = field
def has_child(self, fid):
- return self.byid.has_key(fid)
+ return fid in self.byid
def get_child(self, fid):
return self.byid[fid]
diff --git a/utils/qmidb/Structs.py b/utils/qmidb/Structs.py
index 34e001e..f068fc8 100755
--- a/utils/qmidb/Structs.py
+++ b/utils/qmidb/Structs.py
@@ -336,7 +336,7 @@ class Structs(utils.DbFile):
s.validate(fields, self)
def has_child(self, sid):
- return self.structs.has_key(sid)
+ return sid in self.structs
def get_child(self, sid):
return self.structs[sid]