[Python-checkins] cpython (merge 3.2 -> default): attempt to fix asyncore buildbot failure

giampaolo.rodola python-checkins at python.org
Fri Mar 23 15:10:06 CET 2012


http://hg.python.org/cpython/rev/71b66ba4d9c0
changeset:   75902:71b66ba4d9c0
parent:      75899:94009b75a09d
parent:      75901:2db4e916245a
user:        Giampaolo Rodola' <g.rodola at gmail.com>
date:        Fri Mar 23 15:09:58 2012 +0100
summary:
  attempt to fix asyncore buildbot failure

files:
  Lib/test/test_asyncore.py |  14 +++++++++-----
  1 files changed, 9 insertions(+), 5 deletions(-)


diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -789,14 +789,18 @@
                                                               count=500))
             t.start()
 
-            for x in range(20):
-                s = socket.socket(self.family, socket.SOCK_STREAM)
-                s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
-                             struct.pack('ii', 1, 0))
+
+            s = socket.socket(self.family, socket.SOCK_STREAM)
+            s.settimeout(.2)
+            s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
+                         struct.pack('ii', 1, 0))
+            try:
                 s.connect(server.address)
+            except socket.error:
+                pass
+            finally:
                 s.close()
 
-
 class TestAPI_UseIPv4Sockets(BaseTestAPI):
     family = socket.AF_INET
     addr = (HOST, 0)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list