Changeset 910081d in rtems-source-builder


Ignore:
Timestamp:
08/04/14 08:09:30 (8 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, 5, master
Children:
0393814
Parents:
7c46699
Message:

sb: Fix using hashlib's algorithms on python earlier than 2.7.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source-builder/sb/download.py

    r7c46699 r910081d  
    5959        if len(hash) != 2:
    6060            raise error.internal('invalid hash format: %s' % (file_))
    61         if hash[0] not in hashlib.algorithms:
     61        try:
     62            hashlib_algorithms = hashlib.algorithms
     63        except:
     64            hashlib_algorithms = ['md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512']
     65        if hash[0] not in hashlib_algorithms:
    6266            raise error.general('invalid hash algorithm for %s: %s' % (file_, hash[0]))
    6367        hasher = None
Note: See TracChangeset for help on using the changeset viewer.