summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2006-06-21 16:57:57 (GMT)
committerBrett Cannon <bcannon@gmail.com>2006-06-21 16:57:57 (GMT)
commit70a77ac23f4a3a72ca5722d1c7f85bfd852963fa (patch)
tree87abf01a3a7d8eb4dea61a4d8de7db3b804a2284
parent115ecb9211ec083494d90c88dcbca2da558d1994 (diff)
downloadcpython-70a77ac23f4a3a72ca5722d1c7f85bfd852963fa.zip
cpython-70a77ac23f4a3a72ca5722d1c7f85bfd852963fa.tar.gz
cpython-70a77ac23f4a3a72ca5722d1c7f85bfd852963fa.tar.bz2
At the C level, tuple arguments are passed in directly to the exception
constructor, meaning it is treated as *args, not as a single argument. This means using the 'message' attribute won't work (until Py3K comes around), and so one must grab from 'arg' to get the error number.
-rw-r--r--Lib/test/test_socket_ssl.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_socket_ssl.py b/Lib/test/test_socket_ssl.py
index fc9d09f..41eab69 100644
--- a/Lib/test/test_socket_ssl.py
+++ b/Lib/test/test_socket_ssl.py
@@ -56,11 +56,11 @@ def test_timeout():
use a more reliable address.""" % (ADDR,)
return
except socket.error, exc: # In case connection is refused.
- if (isinstance(exc.message, tuple) and
- exc.message[0] == errno.ECONNREFUSED):
- raise test_support.TestSkipped("test socket connection refused")
+ if exc.args[0] == errno.ECONNREFUSED:
+ print "Connection refused when connecting to", ADDR
+ return
else:
- raise exc
+ raise
ss = socket.ssl(s)
# Read part of return welcome banner twice.