[Python-checkins] r57473 - python/trunk/Lib/test/test_ssl.py

neal.norwitz python-checkins at python.org
Sat Aug 25 19:25:17 CEST 2007


Author: neal.norwitz
Date: Sat Aug 25 19:25:17 2007
New Revision: 57473

Modified:
   python/trunk/Lib/test/test_ssl.py
Log:
Try to get this test to pass for systems that do not have SO_REUSEPORT

Modified: python/trunk/Lib/test/test_ssl.py
==============================================================================
--- python/trunk/Lib/test/test_ssl.py	(original)
+++ python/trunk/Lib/test/test_ssl.py	Sat Aug 25 19:25:17 2007
@@ -176,7 +176,10 @@
         self.certreqs = certreqs
         self.cacerts = cacerts
         self.sock = socket.socket()
-        self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
+        if hasattr(socket, 'SO_REUSEADDR'):
+            self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+        if hasattr(socket, 'SO_REUSEPORT'):
+            self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
         self.sock.bind(('127.0.0.1', port))
         self.active = False
         threading.Thread.__init__(self)


More information about the Python-checkins mailing list