[Python-checkins] cpython: Issue25931: fix tests broken by the conditional define of socketserver.Forking*

gregory.p.smith python-checkins at python.org
Fri Jun 3 01:26:22 EDT 2016


https://hg.python.org/cpython/rev/3145242bc81f
changeset: 101635:3145242bc81f
user: Gregory P. Smith <greg at krypto.org> [Google Inc.]
date: Fri Jun 03 05:26:14 2016 +0000
summary:
 Issue25931: fix tests broken by the conditional define of socketserver.Forking*
files:
 Lib/test/test_socketserver.py | 13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -44,7 +44,7 @@
 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 @@
 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):
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /