summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_asyncore.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index f2fbc58..b8dfad2 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -714,10 +714,15 @@ class BaseTestAPI(unittest.TestCase):
for x in xrange(20):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ s.settimeout(.2)
s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
struct.pack('ii', 1, 0))
- s.connect(server.address)
- s.close()
+ try:
+ s.connect(server.address)
+ except socket.error:
+ pass
+ finally:
+ s.close()
class TestAPI_UseSelect(BaseTestAPI):