Skip to content

Commit

Permalink
[#570] Relax nodes_filter restriction on base fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
aravij committed Aug 6, 2020
1 parent 587ffee commit 2a808bb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions aibolit/ast_framework/computed_fields_catalog/nodes_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 2a808bb

Please sign in to comment.