Skip to content

Commit

Permalink
Refs jschneier#366 -- Duck-type when returning size
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneier authored and nitely committed Jul 30, 2018
1 parent 41f3060 commit 8280cd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storages/backends/s3boto3.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def size(self, name):
if self.entries:
entry = self.entries.get(name)
if entry:
return entry.size
return entry.size if hasattr(entry, 'size') else entry.content_length
return 0
return self.bucket.Object(self._encode_name(name)).content_length

Expand Down

0 comments on commit 8280cd8

Please sign in to comment.