From 2a808bb5a1b9385287774d81ab8001b6f2d1dce2 Mon Sep 17 00:00:00 2001 From: Yaroslav Kishchenko Date: Thu, 6 Aug 2020 12:06:13 +0300 Subject: [PATCH] [#570] Relax nodes_filter restriction on base fields. --- .../ast_framework/computed_fields_catalog/nodes_filter.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/aibolit/ast_framework/computed_fields_catalog/nodes_filter.py b/aibolit/ast_framework/computed_fields_catalog/nodes_filter.py index 5b212038..f50c6919 100644 --- a/aibolit/ast_framework/computed_fields_catalog/nodes_filter.py +++ b/aibolit/ast_framework/computed_fields_catalog/nodes_filter.py @@ -35,11 +35,9 @@ def nodes_filter_factory( def filter(base_node: ASTNode) -> Iterator[ASTNode]: base_field = getattr(base_node, base_field_name) - if isinstance(base_field, list) and all( - isinstance(item, ASTNode) for item in base_field - ): + if isinstance(base_field, list): for node in base_field: - if node.node_type in node_types: + if isinstance(node, ASTNode) and node.node_type in node_types: yield node else: raise RuntimeError(