Skip to content

Commit

Permalink
Sort valid suffixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart committed Jun 23, 2021
1 parent dd5c8be commit 1e5252c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions torchvision/datasets/utils.py
Expand Up @@ -330,8 +330,8 @@ def _detect_file_type(file: str) -> Tuple[str, Optional[str], Optional[str]]:

return suffix, None, suffix

valid_suffixes = set(_FILE_TYPE_ALIASES) | set(_ARCHIVE_EXTRACTORS) | set(_COMPRESSED_FILE_OPENERS)
raise RuntimeError(f"Unknown compression or archive type: '{suffix}'. Known suffixes are: '{valid_suffixes}'.")
valid_suffixes = sorted(set(_FILE_TYPE_ALIASES) | set(_ARCHIVE_EXTRACTORS) | set(_COMPRESSED_FILE_OPENERS))
raise RuntimeError(f"Unknown compression or archive type: '{suffix}'.\nKnown suffixes are: '{valid_suffixes}'.")


def _decompress(from_path: str, to_path: Optional[str] = None, remove_finished: bool = False) -> str:
Expand Down

0 comments on commit 1e5252c

Please sign in to comment.