Mercurial > public > mercurial-scm > hg
comparison mercurial/httpconnection.py @ 35358:8549ca7fcde1
py3: handle keyword arguments correctly in httpconnection.py
Differential Revision: https://phab.mercurial-scm.org/D1634
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 10 Dec 2017 04:47:04 +0530 |
parents | 1232f7fa00c3 |
children | 23d12524a202 |
comparison
equal
deleted
inserted
replaced
35357:056a9c8813aa | 35358:8549ca7fcde1 |
---|---|
246 def http_open(self, req): | 246 def http_open(self, req): |
247 if urllibcompat.getfullurl(req).startswith('https'): | 247 if urllibcompat.getfullurl(req).startswith('https'): |
248 return self.https_open(req) | 248 return self.https_open(req) |
249 def makehttpcon(*args, **kwargs): | 249 def makehttpcon(*args, **kwargs): |
250 k2 = dict(kwargs) | 250 k2 = dict(kwargs) |
251 k2['use_ssl'] = False | 251 k2[r'use_ssl'] = False |
252 return HTTPConnection(*args, **k2) | 252 return HTTPConnection(*args, **k2) |
253 return self.do_open(makehttpcon, req, False) | 253 return self.do_open(makehttpcon, req, False) |
254 | 254 |
255 def https_open(self, req): | 255 def https_open(self, req): |
256 # urllibcompat.getfullurl(req) does not contain credentials and we may | 256 # urllibcompat.getfullurl(req) does not contain credentials and we may |
286 host, port = host.rsplit(':', 1) | 286 host, port = host.rsplit(':', 1) |
287 port = int(port) | 287 port = int(port) |
288 if '[' in host: | 288 if '[' in host: |
289 host = host[1:-1] | 289 host = host[1:-1] |
290 | 290 |
291 kwargs['keyfile'] = keyfile | 291 kwargs[r'keyfile'] = keyfile |
292 kwargs['certfile'] = certfile | 292 kwargs[r'certfile'] = certfile |
293 | 293 |
294 con = HTTPConnection(host, port, use_ssl=True, | 294 con = HTTPConnection(host, port, use_ssl=True, |
295 ssl_wrap_socket=sslutil.wrapsocket, | 295 ssl_wrap_socket=sslutil.wrapsocket, |
296 ssl_validator=sslutil.validatesocket, | 296 ssl_validator=sslutil.validatesocket, |
297 ui=self.ui, | 297 ui=self.ui, |