# HG changeset patch # User Mike Hommey # Date 1411541560 -32400 # Node ID 232d437af1207b524b7228e0e65c0615f4b6c20c # Parent 300e07582e9b9eda73f0d0456ca2f4b3c0dc2f8c keepalive: fix how md5 is used The code in keepalive dates from when it was importing the md5 module directly and uses md5.new. Since then, what 'md5' means has been changed from an import of the md5 module to being a function using the right module between hashlib and md5, so the md5.new idiom doesn't work anymore. diff -r 300e07582e9b -r 232d437af120 mercurial/keepalive.py --- a/mercurial/keepalive.py Tue Sep 16 23:59:29 2014 -0700 +++ b/mercurial/keepalive.py Wed Sep 24 15:52:40 2014 +0900 @@ -635,7 +635,7 @@ fo = urllib2.urlopen(url) foo = fo.read() fo.close() - m = md5.new(foo) + m = md5(foo) print format % ('normal urllib', m.hexdigest()) # now install the keepalive handler and try again @@ -645,7 +645,7 @@ fo = urllib2.urlopen(url) foo = fo.read() fo.close() - m = md5.new(foo) + m = md5(foo) print format % ('keepalive read', m.hexdigest()) fo = urllib2.urlopen(url) @@ -656,7 +656,7 @@ foo = foo + f else: break fo.close() - m = md5.new(foo) + m = md5(foo) print format % ('keepalive readline', m.hexdigest()) def comp(N, url):