##// END OF EJS Templates
util: move md5 back next to sha1 and allow to call it without an argument...
Mike Hommey -
r22958:bb7a911b default
parent child Browse files
Show More
@@ -19,8 +19,6 b''
19 # - fix for digest auth (inspired from urllib2.py @ Python v2.4)
19 # - fix for digest auth (inspired from urllib2.py @ Python v2.4)
20 # Modified by Dirkjan Ochtman:
20 # Modified by Dirkjan Ochtman:
21 # - import md5 function from a local util module
21 # - import md5 function from a local util module
22 # Modified by Martin Geisler:
23 # - moved md5 function from local util module to this module
24 # Modified by Augie Fackler:
22 # Modified by Augie Fackler:
25 # - add safesend method and use it to prevent broken pipe errors
23 # - add safesend method and use it to prevent broken pipe errors
26 # on large POST requests
24 # on large POST requests
@@ -617,16 +615,8 b' def error_handler(url):'
617 print "open connections:", hosts
615 print "open connections:", hosts
618 keepalive_handler.close_all()
616 keepalive_handler.close_all()
619
617
620 def md5(s):
621 try:
622 from hashlib import md5 as _md5
623 except ImportError:
624 from md5 import md5 as _md5
625 global md5
626 md5 = _md5
627 return _md5(s)
628
629 def continuity(url):
618 def continuity(url):
619 from util import md5
630 format = '%25s: %s'
620 format = '%25s: %s'
631
621
632 # first fetch the file with the normal http handler
622 # first fetch the file with the normal http handler
@@ -108,6 +108,15 b" def _fastsha1(s=''):"
108 _fastsha1 = sha1 = _sha1
108 _fastsha1 = sha1 = _sha1
109 return _sha1(s)
109 return _sha1(s)
110
110
111 def md5(s=''):
112 try:
113 from hashlib import md5 as _md5
114 except ImportError:
115 from md5 import md5 as _md5
116 global md5
117 md5 = _md5
118 return _md5(s)
119
111 try:
120 try:
112 buffer = buffer
121 buffer = buffer
113 except NameError:
122 except NameError:
General Comments 0
You need to be logged in to leave comments. Login now