power_insn: fix Fields methods
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 30 Aug 2022 08:47:44 +0000 (11:47 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 30 Aug 2022 10:02:21 +0000 (13:02 +0300)
src/openpower/decoder/power_insn.py

index 1f93c76b67094897282d8053f3beee8b3c3ab244..5949db38482965f9bc855dabe185479732ea49e1 100644 (file)
@@ -396,14 +396,14 @@ class Fields:
     def __repr__(self):
         return repr(self.__mapping)
 
+    def __iter__(self):
+        yield from self.__mapping.items()
+
     def __contains__(self, key):
         return self.__mapping.__contains__(key)
 
     def __getitem__(self, key):
-        return self.__mapping.__getitem__(key)
-
-    def get(self, key, default):
-        return self.__mapping.get(key, default)
+        return self.__mapping.get(key, None)
 
 
 @_functools.total_ordering