From c8efc2643c5d4d10543569e46733e8c094c43eac Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 17 Jul 2024 11:08:08 +0200 Subject: [PATCH] Fix bug in extractor_dict_iterator if element is not str/Path --- src/spikeinterface/core/core_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spikeinterface/core/core_tools.py b/src/spikeinterface/core/core_tools.py index 42d5561547..aad7613d01 100644 --- a/src/spikeinterface/core/core_tools.py +++ b/src/spikeinterface/core/core_tools.py @@ -329,7 +329,7 @@ def recursive_path_modifier(d, func, target="path", copy=True) -> dict: # This is the current definition that an element in a extractor_dict is a path # This is shared across a couple of definition so it is here for DNRY -element_is_path = lambda element: "path" in element.name and isinstance(element.value, (str, Path)) +element_is_path = lambda element: isinstance(element.value, (str, Path)) and "path" in element.name def _get_paths_list(d: dict) -> list[str | Path]: