Skip to content

Commit 10a1809

Browse files
committed
Fix check for file type
1 parent 907a9fa commit 10a1809

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

s3file/storages_optimized.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def _save(self, name, content):
3232
# content.seek(0, os.SEEK_SET) # Disable unnecessary seek operation
3333
# obj.upload_fileobj(content, ExtraArgs=params) # Disable upload function
3434

35-
if not content.obj or not content.obj.key:
35+
if not hasattr(content, "obj") or not hasattr(content.obj, "key"):
3636
raise RuntimeError(
3737
"The content object must be a S3 object and contain a valid key."
3838
)

0 commit comments

Comments
 (0)