[Python-checkins] r47053 - python/trunk/Lib/test/test_socket_ssl.py
brett.cannon
python-checkins at python.org
Wed Jun 21 18:58:00 CEST 2006
Author: brett.cannon
Date: Wed Jun 21 18:57:57 2006
New Revision: 47053
Modified:
python/trunk/Lib/test/test_socket_ssl.py
Log:
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.
Modified: python/trunk/Lib/test/test_socket_ssl.py
==============================================================================
--- python/trunk/Lib/test/test_socket_ssl.py (original)
+++ python/trunk/Lib/test/test_socket_ssl.py Wed Jun 21 18:57:57 2006
@@ -56,11 +56,11 @@
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.
More information about the Python-checkins
mailing list