Blob Blame History Raw
From 57c8fc09f1d574919c5e0bf398c92344b07d4a50 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Thu, 25 Aug 2016 14:47:10 +0200
Subject: [PATCH] Workaround ENOPROTOOPT in bind_port

---
 Lib/test/support/__init__.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 5c03f54..56fd7e6 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -568,7 +568,8 @@ def bind_port(sock, host=HOST):
             if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1:
                 raise TestFailed("tests should never set the SO_REUSEADDR "   \
                                  "socket option on TCP/IP sockets!")
-        if hasattr(socket, 'SO_REUSEPORT'):
+        if hasattr(socket, 'SO_REUSEPORT') \
+                and 'WITHIN_PYTHON_RPM_BUILD' not in os.environ: # rhbz#913732
             try:
                 if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
                     raise TestFailed("tests should never set the SO_REUSEPORT "   \
-- 
2.9.0