Skip to content

Commit 9204aa7

Browse files
committed
make io detection work also for non-existant files
1 parent b64ac22 commit 9204aa7

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

neo/io/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def list_candidate_ios(file_or_folder, ignore_patterns=['*.ini', 'README.txt', '
429429
"""
430430
file_or_folder = pathlib.Path(file_or_folder)
431431

432-
if file_or_folder.is_file():
432+
if file_or_folder.suffix:
433433
suffix = file_or_folder.suffix[1:].lower()
434434
if suffix not in io_by_extension:
435435
raise ValueError(f'{suffix} is not a supported format of any IO.')
@@ -452,12 +452,6 @@ def list_candidate_ios(file_or_folder, ignore_patterns=['*.ini', 'README.txt', '
452452
# to select all files sharing the `session1-` prefix
453453
elif file_or_folder.parent.exists():
454454
filenames = file_or_folder.parent.glob(file_or_folder.name + '*')
455-
456-
elif file_or_folder.suffix:
457-
suffix = file_or_folder.suffix[1:].lower()
458-
if suffix not in io_by_extension:
459-
raise ValueError(f'{suffix} is not a supported format of any IO.')
460-
return io_by_extension[suffix]
461455

462456
else:
463457
raise ValueError(f'{file_or_folder} does not contain data files of a supported format')

0 commit comments

Comments
 (0)