mercurial/url.py
changeset 25660 328739ea70c3
parent 25429 9d1c61715939
child 25837 d343806dcf68
equal deleted inserted replaced
25659:d60678a567a9 25660:328739ea70c3
   157                     if source_address:
   157                     if source_address:
   158                         sock.bind(source_address)
   158                         sock.bind(source_address)
   159                     sock.connect(sa)
   159                     sock.connect(sa)
   160                     return sock
   160                     return sock
   161 
   161 
   162                 except socket.error, msg:
   162                 except socket.error as msg:
   163                     if sock is not None:
   163                     if sock is not None:
   164                         sock.close()
   164                         sock.close()
   165 
   165 
   166             raise socket.error(msg)
   166             raise socket.error(msg)
   167 
   167 
   409         # it doesn't know about the auth type requested. This can happen if
   409         # it doesn't know about the auth type requested. This can happen if
   410         # somebody is using BasicAuth and types a bad password.
   410         # somebody is using BasicAuth and types a bad password.
   411         try:
   411         try:
   412             return urllib2.HTTPDigestAuthHandler.http_error_auth_reqed(
   412             return urllib2.HTTPDigestAuthHandler.http_error_auth_reqed(
   413                         self, auth_header, host, req, headers)
   413                         self, auth_header, host, req, headers)
   414         except ValueError, inst:
   414         except ValueError as inst:
   415             arg = inst.args[0]
   415             arg = inst.args[0]
   416             if arg.startswith("AbstractDigestAuthHandler doesn't know "):
   416             if arg.startswith("AbstractDigestAuthHandler doesn't know "):
   417                 return
   417                 return
   418             raise
   418             raise
   419 
   419