Skip to content

Commit

Permalink
Refs #366 -- Duck-type when returning size
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneier committed Aug 14, 2017
1 parent 12f494c commit e5c1dfd
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 @@ -500,7 +500,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 e5c1dfd

Please sign in to comment.