S3Bucket.listdir() method raised UnboundLocalError when the result list is empty. This patch fixes the bug. You can reproduce the bug by running following code:
from simples3.bucket import S3Bucket
S3_BUCKET_NAME = '...'
S3_ACCESS_KEY = '...'
S3_SECRET_KEY = '...'
bucket = S3Bucket(S3_BUCKET_NAME, S3_ACCESS_KEY, S3_SECRET_KEY)
# The above code works well both.
for x in bucket.listdir(prefix='existing-prefix'):
print x
# The above code works only after this patch.
for x in bucket.listdir(prefix='not-existing-prefix'):
print x
This bug fix has done by Hyunjun Kim, an employee of my company. Thank you!
S3Bucket.listdir()
method raisedUnboundLocalError
when the result list is empty. This patch fixes the bug. You can reproduce the bug by running following code:This bug fix has done by Hyunjun Kim, an employee of my company. Thank you!