# HG changeset patch # User Mike Hommey # Date 2014-09-24 06:52:40 # 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 --git a/mercurial/keepalive.py b/mercurial/keepalive.py --- a/mercurial/keepalive.py +++ b/mercurial/keepalive.py @@ -635,7 +635,7 @@ def continuity(url): 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 @@ def continuity(url): 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 @@ def continuity(url): foo = foo + f else: break fo.close() - m = md5.new(foo) + m = md5(foo) print format % ('keepalive readline', m.hexdigest()) def comp(N, url):