Author: Philip Jenvey <pjen...@underboss.org>
Branch: py3.5
Changeset: r92411:8086c7a846ff
Date: 2017-09-16 12:19 -0700
http://bitbucket.org/pypy/pypy/changeset/8086c7a846ff/

Log:    handle SO_REUSEPORT defined but not implemented

        follows up 7ade09ee3ac5, see also https://bugs.python.org/issue26858

diff --git a/lib-python/3/test/test_asyncio/test_base_events.py 
b/lib-python/3/test/test_asyncio/test_base_events.py
--- a/lib-python/3/test/test_asyncio/test_base_events.py
+++ b/lib-python/3/test/test_asyncio/test_base_events.py
@@ -1588,9 +1588,15 @@
                 sock.getsockopt(
                     socket.SOL_SOCKET, socket.SO_REUSEADDR))
         if reuseport_supported:
-            self.assertFalse(
-                sock.getsockopt(
-                    socket.SOL_SOCKET, socket.SO_REUSEPORT))
+            try:
+                self.assertFalse(
+                    sock.getsockopt(
+                        socket.SOL_SOCKET, socket.SO_REUSEPORT))
+            except OSError:
+                # Python's socket module was compiled using modern headers
+                # thus defining SO_REUSEPORT but this process is running
+                # under an older kernel that does not support SO_REUSEPORT.
+                reuseport_supported = False
         self.assertFalse(
             sock.getsockopt(
                 socket.SOL_SOCKET, socket.SO_BROADCAST))
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to