summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-06-29 05:48:14 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-06-29 05:48:14 (GMT)
commit877fdb01fed44e00863f09150b449aa838a3d3dc (patch)
treece42c5b24ad9e0ab2ce68e011bb1a4745497a61e /Lib
parentb15ac3169d5958e294e09f8daeab0f413e76d0a3 (diff)
downloadcpython-877fdb01fed44e00863f09150b449aa838a3d3dc.zip
cpython-877fdb01fed44e00863f09150b449aa838a3d3dc.tar.gz
cpython-877fdb01fed44e00863f09150b449aa838a3d3dc.tar.bz2
This should fix the buildbot failure on s/390 which can't connect to gmail.org.
It makes the error message consistent and always sends to stderr. It would be much better for all the networking tests to hit only python.org.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_socket_ssl.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/Lib/test/test_socket_ssl.py b/Lib/test/test_socket_ssl.py
index 41eab69..3c9c9f0 100644
--- a/Lib/test/test_socket_ssl.py
+++ b/Lib/test/test_socket_ssl.py
@@ -34,6 +34,13 @@ def test_basic():
def test_timeout():
test_support.requires('network')
+ def error_msg(extra_msg):
+ print >> sys.stderr, """\
+ WARNING: an attempt to connect to %r %s, in
+ test_timeout. That may be legitimate, but is not the outcome we hoped
+ for. If this message is seen often, test_timeout should be changed to
+ use a more reliable address.""" % (ADDR, extra_msg)
+
if test_support.verbose:
print "test_timeout ..."
@@ -49,15 +56,11 @@ def test_timeout():
try:
s.connect(ADDR)
except socket.timeout:
- print >> sys.stderr, """\
- WARNING: an attempt to connect to %r timed out, in
- test_timeout. That may be legitimate, but is not the outcome we hoped
- for. If this message is seen often, test_timeout should be changed to
- use a more reliable address.""" % (ADDR,)
+ error_msg('timed out')
return
except socket.error, exc: # In case connection is refused.
if exc.args[0] == errno.ECONNREFUSED:
- print "Connection refused when connecting to", ADDR
+ error_msg('was refused')
return
else:
raise