From 6ecf60ca5eb94f0d1d09d6dbbe0d9a89adc1a0c0 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 30 Aug 2022 11:47:44 +0300 Subject: [PATCH] power_insn: fix Fields methods --- src/openpower/decoder/power_insn.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 1f93c76b..5949db38 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -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 -- 2.30.2