Skip to content

Commit

Permalink
Cast tuple of filenames to list to improve error handling (#12891)
Browse files Browse the repository at this point in the history
  • Loading branch information
mscheltienne authored Oct 9, 2024
1 parent 53f258d commit 06050bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mne/io/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ def filenames(self) -> tuple[Path | None, ...]:
def filenames(self, value):
"""The filenames used, cast to list of paths.""" # noqa: D401
_validate_type(value, (list, tuple), "filenames")
if isinstance(value, tuple):
value = list(value)
for k, elt in enumerate(value):
if elt is not None:
value[k] = _check_fname(elt, overwrite="read", must_exist=False)
Expand Down

0 comments on commit 06050bc

Please sign in to comment.