util: remove warnings when importing md5 and sha
authorSune Foldager <cryo@cyanite.org>
Mon, 04 May 2009 20:29:05 +0200
changeset 8295 1ea7e7d90007
parent 8294 48a382c23226
child 8296 908c5906091b
util: remove warnings when importing md5 and sha
mercurial/util.py
--- a/mercurial/util.py	Mon May 04 15:31:57 2009 +0200
+++ b/mercurial/util.py	Mon May 04 20:29:05 2009 +0200
@@ -25,8 +25,7 @@
         import hashlib
         _md5 = hashlib.md5
     except ImportError:
-        import md5
-        _md5 = md5.md5
+        from md5 import md5 as _md5
     global md5
     md5 = _md5
     return _md5(s)
@@ -36,8 +35,7 @@
         import hashlib
         _sha1 = hashlib.sha1
     except ImportError:
-        import sha
-        _sha1 = sha.sha
+        from sha import sha as _sha1
     global sha1
     sha1 = _sha1
     return _sha1(s)