summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-03-19 22:26:27 (GMT)
committerGuido van Rossum <guido@python.org>2007-03-19 22:26:27 (GMT)
commit89df245607619ed532106fbbdbf80745815f9c96 (patch)
treea1c294e5126fadd2f5a0dbdbdba912ceb619b127 /Lib/httplib.py
parent7cba8508afeac3c631ea225df2df0e4918c610ab (diff)
downloadcpython-89df245607619ed532106fbbdbf80745815f9c96.zip
cpython-89df245607619ed532106fbbdbf80745815f9c96.tar.gz
cpython-89df245607619ed532106fbbdbf80745815f9c96.tar.bz2
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].
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py8
1 files 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: