Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Commit

Permalink
improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu-g committed Apr 7, 2022
1 parent b4d8a53 commit d3e7d95
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/kyoto_reader/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,11 @@ def __init__(self,
logger.info(f'got an archive file path, files in the archive are treated as source files')
self.archive_handler = ArchiveHandler(source)
file_paths: List[FileHandler] = sorted(FileHandler(Path(p)) for p in self.archive_handler.members)
else:
elif source.is_file():
logger.info(f'got a single file path, this file is treated as a source file')
assert source.is_file() is True
file_paths: List[FileHandler] = [FileHandler(source)]
else:
raise ValueError(f'document source: {source} not found')

self.did2pkls = {file.path.stem: file for file in file_paths if file.content_basename.endswith(pickle_ext)}
if n_jobs == -1:
Expand Down

0 comments on commit d3e7d95

Please sign in to comment.