From: Dmitry Selyutin Date: Sat, 10 Jun 2023 17:01:52 +0000 (+0300) Subject: insndb/core: replace walkability check X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=49de9819e952433e2e047157c9060ddbcf846f82;p=openpower-isa.git insndb/core: replace walkability check --- diff --git a/src/openpower/insndb/core.py b/src/openpower/insndb/core.py index 2c7abe79..68fdfe20 100644 --- a/src/openpower/insndb/core.py +++ b/src/openpower/insndb/core.py @@ -81,7 +81,7 @@ class DataclassMeta(type): return _dataclasses.dataclass(cls, eq=True, frozen=True) -class Dataclass(metaclass=DataclassMeta): +class Dataclass(Node, metaclass=DataclassMeta): @walkmethod def walk(clsself, match=None): if match is None: @@ -171,7 +171,7 @@ def walk(root, match=None): def visit(visitor, node): with visitor(node=node): - if hasattr(node, "walk"): + if isinstance(node, Node): for subnode in node.walk(): visit(visitor=visitor, node=subnode)