summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-04-09 00:41:25 +0000
committerGuido van Rossum <guido@python.org>2007-04-09 00:41:25 +0000
commit5228cb2472da65cd5b7194bd3fb9864345f3d67b (patch)
tree95a5b2ba248d3ca13f0c01c4be86bcc06e867c82 /Lib
parentce2346590e5717289f80707b5b814148a10d1c7a (diff)
downloadcpython-5228cb2472da65cd5b7194bd3fb9864345f3d67b.tar.gz
Make sure that a forked child process exits even if it raises an exception.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_mailbox.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 181e32b555..803edd589d 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -735,10 +735,12 @@ class _TestMboxMMDF(TestMailbox):
pid = os.fork()
if pid == 0:
# In the child, lock the mailbox.
- self._box.lock()
- time.sleep(2)
- self._box.unlock()
- os._exit(0)
+ try:
+ self._box.lock()
+ time.sleep(2)
+ self._box.unlock()
+ finally:
+ os._exit(0)
# In the parent, sleep a bit to give the child time to acquire
# the lock.