[Python-checkins] cpython: Issue #18786: Don't reinstall old SIGUSR1 handler prematurely.
richard.oudkerk
python-checkins at python.org
Wed Aug 28 14:57:30 CEST 2013
http://hg.python.org/cpython/rev/fa23e49c7dd3
changeset: 85434:fa23e49c7dd3
user: Richard Oudkerk <shibturn at gmail.com>
date: Wed Aug 28 13:50:19 2013 +0100
summary:
Issue #18786: Don't reinstall old SIGUSR1 handler prematurely.
files:
Lib/test/_test_multiprocessing.py | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -2925,7 +2925,7 @@
@classmethod
def _killer(cls, pid):
- time.sleep(0.5)
+ time.sleep(0.1)
os.kill(pid, signal.SIGUSR1)
@unittest.skipUnless(hasattr(signal, 'SIGUSR1'), 'requires SIGUSR1')
@@ -2938,12 +2938,14 @@
try:
killer = self.Process(target=self._killer, args=(pid,))
killer.start()
- p = self.Process(target=time.sleep, args=(1,))
- p.start()
- p.join()
+ try:
+ p = self.Process(target=time.sleep, args=(2,))
+ p.start()
+ p.join()
+ finally:
+ killer.join()
self.assertTrue(got_signal[0])
self.assertEqual(p.exitcode, 0)
- killer.join()
finally:
signal.signal(signal.SIGUSR1, oldhandler)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list