equal
deleted
inserted
replaced
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 |