diff mercurial/mdiff.py @ 6470:ac0bcd951c2c

python 2.6 compatibility: compatibility wrappers for hash functions
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Fri, 04 Apr 2008 22:36:40 +0200
parents 65029a3aafc2
children 13fe85fe396b
line wrap: on
line diff
--- a/mercurial/mdiff.py	Fri Apr 04 22:41:17 2008 +0200
+++ b/mercurial/mdiff.py	Fri Apr 04 22:36:40 2008 +0200
@@ -6,7 +6,7 @@
 # of the GNU General Public License, incorporated herein by reference.
 
 from i18n import _
-import bdiff, mpatch, re, struct, util, md5
+import bdiff, mpatch, re, struct, util
 
 def splitnewlines(text):
     '''like str.splitlines, but only split on newlines.'''
@@ -80,7 +80,7 @@
     if not opts.text and (util.binary(a) or util.binary(b)):
         def h(v):
             # md5 is used instead of sha1 because md5 is supposedly faster
-            return md5.new(v).digest()
+            return util.md5(v).digest()
         if a and b and len(a) == len(b) and h(a) == h(b):
             return ""
         l = ['Binary file %s has changed\n' % fn1]