[Python-checkins] r47159 - python/trunk/Lib/test/test_socket_ssl.py
neal.norwitz
python-checkins at python.org
Thu Jun 29 07:48:15 CEST 2006
Author: neal.norwitz
Date: Thu Jun 29 07:48:14 2006
New Revision: 47159
Modified:
python/trunk/Lib/test/test_socket_ssl.py
Log:
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.
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 Thu Jun 29 07:48:14 2006
@@ -34,6 +34,13 @@
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 @@
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
More information about the Python-checkins
mailing list