Commit 5982ce08 authored by Brett Cannon's avatar Brett Cannon

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.
parent 65f0889b
...@@ -56,11 +56,11 @@ def test_timeout(): ...@@ -56,11 +56,11 @@ def test_timeout():
use a more reliable address.""" % (ADDR,) use a more reliable address.""" % (ADDR,)
return return
except socket.error, exc: # In case connection is refused. except socket.error, exc: # In case connection is refused.
if (isinstance(exc.message, tuple) and if exc.args[0] == errno.ECONNREFUSED:
exc.message[0] == errno.ECONNREFUSED): print "Connection refused when connecting to", ADDR
raise test_support.TestSkipped("test socket connection refused") return
else: else:
raise exc raise
ss = socket.ssl(s) ss = socket.ssl(s)
# Read part of return welcome banner twice. # Read part of return welcome banner twice.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment