From 7a7baed8e4266f29a0e44b8c8d2797d861cafdc8 Mon Sep 17 00:00:00 2001 From: Alejandro de la Vega Date: Tue, 29 Jun 2021 17:39:39 -0500 Subject: [PATCH] Exclude dicts from set --- bids/layout/layout.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bids/layout/layout.py b/bids/layout/layout.py index 38aa62906..855222728 100644 --- a/bids/layout/layout.py +++ b/bids/layout/layout.py @@ -678,7 +678,9 @@ def get(self, return_type='object', target=None, scope='all', results = [x for x in results if target in x.entities] if return_type == 'id': - results = list(set([x.entities[target] for x in results])) + results = list(set( + [x.entities[target] for x in results + if type(x.entities[target]) is not dict])) results = natural_sort(results) elif return_type == 'dir':