From 89df245607619ed532106fbbdbf80745815f9c96 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 19 Mar 2007 22:26:27 +0000 Subject: Make test_socket_ssl.py pass by fixing some code that was incorrectly assuming that err.message was the Py3k way of writing err[0] in 2.x. The correct spelling is err.args[0]. --- Lib/httplib.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/httplib.py b/Lib/httplib.py index 32889cc..8876aad 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -714,7 +714,7 @@ class HTTPConnection: else: self.sock.sendall(str) except socket.error as v: - if v[0] == 32: # Broken pipe + if v.args[0] == 32: # Broken pipe self.close() raise @@ -870,7 +870,7 @@ class HTTPConnection: self._send_request(method, url, body, headers) except socket.error as v: # trap 'Broken pipe' if we're allowed to automatically reconnect - if v.message != 32 or not self.auto_open: + if v.args[0] != 32 or not self.auto_open: raise # try one more time self._send_request(method, url, body, headers) @@ -1020,7 +1020,7 @@ class SSLFile(SharedSocketClient): try: buf = self._ssl.read(self._bufsize) except socket.sslerror as err: - err_type = err.message + err_type = err.args[0] if (err_type == socket.SSL_ERROR_WANT_READ or err_type == socket.SSL_ERROR_WANT_WRITE): continue @@ -1029,7 +1029,7 @@ class SSLFile(SharedSocketClient): break raise except socket.error as err: - err_type = err.message + err_type = err.args[0] if err_type == errno.EINTR: continue if err_type == errno.EBADF: -- cgit v0.12