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.
--- 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):