don't redefine hash
built-in
Signed-off-by: Nils Philippsen <nils@redhat.com>
This commit is contained in:
parent
4a590170b0
commit
5e4a0e45a3
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue