diff options
-rw-r--r-- | ryu/ofproto/ofproto_parser.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ryu/ofproto/ofproto_parser.py b/ryu/ofproto/ofproto_parser.py index 8cb04024..bfb9866f 100644 --- a/ryu/ofproto/ofproto_parser.py +++ b/ryu/ofproto/ofproto_parser.py @@ -58,7 +58,11 @@ def create_list_of_base_attributes(f): @functools.wraps(f) def wrapper(self, *args, **kwargs): ret = f(self, *args, **kwargs) - self._base_attributes = set(dir(self)) + cls = self.__class__ + # hasattr(cls, '_base_attributes') doesn't work because super class + # may already have the attribute. + if '_base_attributes' not in cls.__dict__: + cls._base_attributes = set(dir(self)) return ret return wrapper |