From cc5c728513a5bb8850591fba870a380573f4e078 Mon Sep 17 00:00:00 2001 From: Richard Oudkerk Date: Thu, 17 Oct 2013 15:22:10 +0100 Subject: Fix signal handler in test. --- Lib/test/_test_multiprocessing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index d02106d..993c875 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -354,12 +354,16 @@ class _TestProcess(BaseTestCase): else: os.kill(pid, signal.SIGTERM) def handler(*args): - raise RuntimeError('join took too long: %s' % p) + raise RuntimeError('waitpid() took too long') old_handler = signal.signal(signal.SIGALRM, handler) try: signal.alarm(10) pid_status = os.waitpid(pid, 0) self.assertEqual(pid_status[0], pid) + except RuntimeError: + print('os.waitpid() =', + os.waitpid(pid, os.WNOHANG), file=sys.stderr) + raise finally: signal.alarm(0) signal.signal(signal.SIGALRM, old_handler) -- cgit v0.12