don't redefine hash built-in

Signed-off-by: Nils Philippsen <nils@redhat.com>
This commit is contained in:
Nils Philippsen 2019-11-22 14:59:22 +01:00
parent 4a590170b0
commit 5e4a0e45a3

View file

@ -82,11 +82,11 @@ def needs_update(local_file, remote_sha, sha_type):
if sha_type == 'sha':
sha_type = 'sha1'
hash = getattr(hashlib, sha_type)()
hashobj = getattr(hashlib, sha_type)()
with open(local_file, 'rb') as f:
hash.update(f.read())
hashobj.update(f.read())
local_sha = hash.hexdigest()
local_sha = hashobj.hexdigest()
if local_sha != remote_sha:
return True