changed the getList default to an empty list instead of None, because otherwise an exception is raised when trying to iterate over an empty list

This commit is contained in:
Sanjeev Suresh 2018-06-21 15:26:27 -07:00
parent 38a4558925
commit 29da006f78

View File

@ -718,7 +718,7 @@ class S3Backend(BaseBackend):
if key_name in bucket.keys:
key = bucket.keys[key_name]
else:
for key_version in bucket.keys.getlist(key_name):
for key_version in bucket.keys.getlist(key_name, default=[]):
if str(key_version.version_id) == str(version_id):
key = key_version
break