mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
sb: Fix using hashlib's algorithms on python earlier than 2.7.
This commit is contained in:
parent
7c46699472
commit
910081d515
@ -58,7 +58,11 @@ def _hash_check(file_, absfile, macros, remove = True):
|
||||
hash = hash.split()
|
||||
if len(hash) != 2:
|
||||
raise error.internal('invalid hash format: %s' % (file_))
|
||||
if hash[0] not in hashlib.algorithms:
|
||||
try:
|
||||
hashlib_algorithms = hashlib.algorithms
|
||||
except:
|
||||
hashlib_algorithms = ['md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512']
|
||||
if hash[0] not in hashlib_algorithms:
|
||||
raise error.general('invalid hash algorithm for %s: %s' % (file_, hash[0]))
|
||||
hasher = None
|
||||
_in = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user