summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 91478cb..3a8abfc 100644
--- a/setup.py
+++ b/setup.py
@@ -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