diff options
author | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2011-10-10 15:36:02 -0400 |
---|---|---|
committer | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2011-10-10 16:05:23 -0400 |
commit | c90c797a58f455765dbf5745690d6a0f91e2b145 (patch) | |
tree | c05679b212a15caca7b56708866f86c5eaa00173 /setup.py | |
parent | 75915871a3187354b69d4db411cffaa1955eec42 (diff) | |
download | pycrypto-c90c797a58f455765dbf5745690d6a0f91e2b145.tar.gz |
Don't test SHA224/384/512 where hashlib isn't available (Python < 2.5)
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -84,6 +84,14 @@ else: if sys.platform != "win32": # Avoid nt.py, as 2to3 can't fix it w/o winrandom EXCLUDE_PY += [('Crypto.Random.OSRNG','nt')] +# Exclude SHA224/384/512 if they're not present (Python < 2.5) +try: from hashlib import sha224 +except ImportError: EXCLUDE_PY += [('Crypto.Hash', 'SHA224')] +try: from hashlib import sha384 +except ImportError: EXCLUDE_PY += [('Crypto.Hash', 'SHA384')] +try: from hashlib import sha512 +except ImportError: EXCLUDE_PY += [('Crypto.Hash', 'SHA512')] + # Work around the print / print() issue with Python 2.x and 3.x. We only need # to print at one point of the code, which makes this easy |