setup: warn about missing standard Python components
authorMatt Mackall <mpm@selenic.com>
Wed, 31 Dec 2008 17:59:58 -0600
changeset 7558 dc211ad8d681
parent 7557 21233de9c053
child 7559 016a7319e76b
setup: warn about missing standard Python components
setup.py
--- a/setup.py	Sat Dec 27 19:05:26 2008 +0100
+++ b/setup.py	Wed Dec 31 17:59:58 2008 -0600
@@ -9,6 +9,23 @@
 if not hasattr(sys, 'version_info') or sys.version_info < (2, 3, 0, 'final'):
     raise SystemExit("Mercurial requires python 2.3 or later.")
 
+# Solaris Python packaging brain damage
+try:
+    import hashlib
+    sha = hashlib.sha1()
+except:
+    try:
+        import sha
+    except:
+        raise SystemExit(
+            "Couldn't import standard hashlib (incomplete Python install).")
+
+try:
+    import zlib
+except:
+    raise SystemExit(
+        "Couldn't import standard zlib (incomplete Python install).")
+
 import os
 import shutil
 import tempfile