summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) <greg@krypto.org>2016-06-03 05:26:14 (GMT)
committerGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) <greg@krypto.org>2016-06-03 05:26:14 (GMT)
commita945969d717dc8fcb5ca22691f98198b5173b740 (patch)
treea05e55ca032c1efb0af57dc069250d2dc848dbb4
parentaea1650389e65fd4aefaedfa0b779ffc4885d690 (diff)
downloadcpython-a945969d717dc8fcb5ca22691f98198b5173b740.zip
cpython-a945969d717dc8fcb5ca22691f98198b5173b740.tar.gz
cpython-a945969d717dc8fcb5ca22691f98198b5173b740.tar.bz2
Issue25931: fix tests broken by the conditional define of socketserver.Forking*
-rw-r--r--Lib/test/test_socketserver.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
index 01ac12b..9a90729 100644
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -44,7 +44,7 @@ def receive(sock, n, timeout=20):
else:
raise RuntimeError("timed out on %r" % (sock,))
-if HAVE_UNIX_SOCKETS:
+if HAVE_UNIX_SOCKETS and HAVE_FORKING:
class ForkingUnixStreamServer(socketserver.ForkingMixIn,
socketserver.UnixStreamServer):
pass
@@ -368,11 +368,12 @@ class ThreadingErrorTestServer(socketserver.ThreadingMixIn,
self.done.wait()
-class ForkingErrorTestServer(socketserver.ForkingMixIn, BaseErrorTestServer):
- def wait_done(self):
- [child] = self.active_children
- os.waitpid(child, 0)
- self.active_children.clear()
+if HAVE_FORKING:
+ class ForkingErrorTestServer(socketserver.ForkingMixIn, BaseErrorTestServer):
+ def wait_done(self):
+ [child] = self.active_children
+ os.waitpid(child, 0)
+ self.active_children.clear()
class MiscTestCase(unittest.TestCase):