mercurial/util.py
branchstable
changeset 12051 ff5cec76b1c5
parent 11758 a79214972da2
child 12054 5d22e631c365
child 12344 b6173aee4a47
--- a/mercurial/util.py	Mon Aug 16 12:55:42 2010 -0500
+++ b/mercurial/util.py	Tue Aug 17 17:38:19 2010 -0500
@@ -28,9 +28,9 @@
     # This function will import sha1 from hashlib or sha (whichever is
     # available) and overwrite itself with it on the first call.
     # Subsequent calls will go directly to the imported function.
-    try:
+    if sys.version_info >= (2, 5):
         from hashlib import sha1 as _sha1
-    except ImportError:
+    else:
         from sha import sha as _sha1
     global _fastsha1, sha1
     _fastsha1 = sha1 = _sha1