diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py index 51747b1..df448e0 100644 --- a/source-builder/sb/download.py +++ b/source-builder/sb/download.py @@ -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