Mercurial > hg
comparison mercurial/url.py @ 26806:ec12ebe20200
url: drop support for python2.5
author | timeless <timeless@mozdev.org> |
---|---|
date | Thu, 15 Oct 2015 17:21:08 -0400 |
parents | 56b2bcea2529 |
children | 86db5cb55d46 |
comparison
equal
deleted
inserted
replaced
26805:e999ed2192ef | 26806:ec12ebe20200 |
---|---|
417 def http_error_auth_reqed(self, auth_header, host, req, headers): | 417 def http_error_auth_reqed(self, auth_header, host, req, headers): |
418 # Reset the retry counter once for each request. | 418 # Reset the retry counter once for each request. |
419 if req is not self.retried_req: | 419 if req is not self.retried_req: |
420 self.retried_req = req | 420 self.retried_req = req |
421 self.retried = 0 | 421 self.retried = 0 |
422 # In python < 2.5 AbstractDigestAuthHandler raises a ValueError if | 422 return urllib2.HTTPDigestAuthHandler.http_error_auth_reqed( |
423 # it doesn't know about the auth type requested. This can happen if | 423 self, auth_header, host, req, headers) |
424 # somebody is using BasicAuth and types a bad password. | |
425 try: | |
426 return urllib2.HTTPDigestAuthHandler.http_error_auth_reqed( | |
427 self, auth_header, host, req, headers) | |
428 except ValueError as inst: | |
429 arg = inst.args[0] | |
430 if arg.startswith("AbstractDigestAuthHandler doesn't know "): | |
431 return | |
432 raise | |
433 | 424 |
434 class httpbasicauthhandler(urllib2.HTTPBasicAuthHandler): | 425 class httpbasicauthhandler(urllib2.HTTPBasicAuthHandler): |
435 def __init__(self, *args, **kwargs): | 426 def __init__(self, *args, **kwargs): |
436 self.auth = None | 427 self.auth = None |
437 urllib2.HTTPBasicAuthHandler.__init__(self, *args, **kwargs) | 428 urllib2.HTTPBasicAuthHandler.__init__(self, *args, **kwargs) |