Refactoring for easier to read

This commit is contained in:
Ching Yi, Chan 2015-06-05 23:29:11 +08:00
parent ed5ea7e921
commit 1517ae8ab2

View file

@ -299,9 +299,7 @@ def is_walrus(s3_url):
def get_md5_digest(local_file):
md5 = hashlib.md5()
with open(local_file, 'rb') as f:
while True:
data = f.read(1024 ** 2)
if not data: break
for data in f.read(1024 ** 2):
md5.update(data)
return md5.hexdigest()