From 49de9819e952433e2e047157c9060ddbcf846f82 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sat, 10 Jun 2023 20:01:52 +0300 Subject: [PATCH] insndb/core: replace walkability check --- src/openpower/insndb/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.30.2