From: Richard Oudkerk Date: Thu, 17 Oct 2013 14:22:10 +0000 (+0100) Subject: Fix signal handler in test. X-Git-Tag: v3.4.0a4~81 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cc5c728513a5bb8850591fba870a380573f4e078;p=thirdparty%2FPython%2Fcpython.git Fix signal handler in test. --- diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index d02106d164d6..993c8750b6cb 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)