Skip to content

Commit

Permalink
Make sure renaming runless_file fails if targets is out of sync (to b…
Browse files Browse the repository at this point in the history
…etter reveal any bugs)
  • Loading branch information
marcelzwiers committed Feb 14, 2024
1 parent 3898816 commit c07eb44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bidscoin/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c07eb44

Please sign in to comment.