changeset 22505:232d437af120 stable

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.
author Mike Hommey <mh@glandium.org>
date Wed, 24 Sep 2014 15:52:40 +0900
parents 300e07582e9b
children 6e1fbcb18a75
files mercurial/keepalive.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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):