]> granicus.if.org Git - python/commitdiff
Issue25931: fix tests broken by the conditional define of socketserver.Forking*
authorGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) <greg@krypto.org>
Fri, 3 Jun 2016 05:26:14 +0000 (05:26 +0000)
committerGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) <greg@krypto.org>
Fri, 3 Jun 2016 05:26:14 +0000 (05:26 +0000)
Lib/test/test_socketserver.py

index 01ac12b949eb1a950ff1b217195fce893a6567c1..9a907292aa74df04340fc84d3243d6410eded8a2 100644 (file)
@@ -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):