Author: guido.van.rossum
Date: Mon Apr  9 02:41:25 2007
New Revision: 54718

Modified:
   python/branches/p3yk/Lib/test/test_mailbox.py
Log:
Make sure that a forked child process exits even if it raises an exception.


Modified: python/branches/p3yk/Lib/test/test_mailbox.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_mailbox.py       (original)
+++ python/branches/p3yk/Lib/test/test_mailbox.py       Mon Apr  9 02:41:25 2007
@@ -735,10 +735,12 @@
         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.
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to