Skip to content

Commit

Permalink
Default to using actual file size
Browse files Browse the repository at this point in the history
  • Loading branch information
jdidion committed Nov 19, 2017
1 parent a700791 commit 1b77276
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions xphyle/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,14 @@ def uncompressed_size(
Raises:
ValueError if the compression format is not supported.
"""
if not isinstance(compression, str):
compression = FORMATS.guess_compression_format(path)
fmt = FORMATS.get_compression_format(compression)
return fmt.uncompressed_size(path)
if compression is not False:
if not isinstance(compression, str):
compression = FORMATS.guess_compression_format(path)
if compression is not None:
fmt = FORMATS.get_compression_format(compression)
return fmt.uncompressed_size(path)
# Assume the file is not compressed to begin with
return os.stat(path).st_size

# EventListeners

Expand Down

0 comments on commit 1b77276

Please sign in to comment.