comparison mercurial/url.py @ 25207:6358391453f3

url: drop awful hack around bug in Python 2.4 It's all just a memory now.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 18 May 2015 16:51:02 -0500
parents bf07c19b4c82
children f7ccbc2776b7
comparison
equal deleted inserted replaced
25206:18a032704f0a 25207:6358391453f3
117 return None 117 return None
118 if e.startswith('*.') and host.endswith(e[2:]): 118 if e.startswith('*.') and host.endswith(e[2:]):
119 return None 119 return None
120 if e.startswith('.') and host.endswith(e[1:]): 120 if e.startswith('.') and host.endswith(e[1:]):
121 return None 121 return None
122
123 # work around a bug in Python < 2.4.2
124 # (it leaves a "\n" at the end of Proxy-authorization headers)
125 baseclass = req.__class__
126 class _request(baseclass):
127 def add_header(self, key, val):
128 if key.lower() == 'proxy-authorization':
129 val = val.strip()
130 return baseclass.add_header(self, key, val)
131 req.__class__ = _request
132 122
133 return urllib2.ProxyHandler.proxy_open(self, req, proxy, type_) 123 return urllib2.ProxyHandler.proxy_open(self, req, proxy, type_)
134 124
135 def _gen_sendfile(orgsend): 125 def _gen_sendfile(orgsend):
136 def _sendfile(self, data): 126 def _sendfile(self, data):