# HG changeset patch # User Sune Foldager # Date 2009-05-04 18:29:05 # Node ID 1ea7e7d900075fc3a8ab8a3e8c03d279a82f12a4 # Parent 48a382c23226736ee2023a23ff17fe8a51b500fa util: remove warnings when importing md5 and sha diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -25,8 +25,7 @@ def md5(s): 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 @@ def sha1(s): 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)