From c07eb441f8addd4951285485ae2a6d8ed9648ca8 Mon Sep 17 00:00:00 2001 From: Marcel Zwiers Date: Wed, 14 Feb 2024 16:29:22 +0100 Subject: [PATCH] Make sure renaming runless_file fails if targets is out of sync (to better reveal any bugs) --- bidscoin/bids.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bidscoin/bids.py b/bidscoin/bids.py index 0269b377..88d3011c 100644 --- a/bidscoin/bids.py +++ b/bidscoin/bids.py @@ -2004,7 +2004,7 @@ def increment_runindex(outfolder: Path, bidsname: str, run: Run, targets: set=() LOGGER.verbose(f"Found run-2 files for <<>> index, renaming\n{runless_file} -> {run1_name}") run1_file = (outfolder/run1_name).with_suffix(''.join(runless_file.suffixes)) runless_file.replace(run1_file) - if runless_file in targets: + if isinstance(targets, set): targets.remove(runless_file) targets.add(run1_file)