summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-08-11 06:09:41 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-08-11 06:09:41 (GMT)
commit003c9e29520a24da7177f16fe26e758c6baeaaca (patch)
tree6be60973ee2c4398d93510aafa7309ba264689ae /Lib
parent8b8c59cf1db86682fdc48791a0fcfa997d36eb06 (diff)
downloadcpython-003c9e29520a24da7177f16fe26e758c6baeaaca.zip
cpython-003c9e29520a24da7177f16fe26e758c6baeaaca.tar.gz
cpython-003c9e29520a24da7177f16fe26e758c6baeaaca.tar.bz2
Fix the failures on cygwin (2006-08-10 fixed the actual locking issue).
The first hunk changes the colon to an ! like other Windows variants. We need to always wait on the child so the lock gets released and no other tests fail. This is the try/finally in the second hunk.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_mailbox.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 45dd118..6cdc441 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -1,4 +1,5 @@
import os
+import sys
import time
import stat
import socket
@@ -461,7 +462,7 @@ class TestMaildir(TestMailbox):
def setUp(self):
TestMailbox.setUp(self)
- if os.name in ('nt', 'os2'):
+ if os.name in ('nt', 'os2') or sys.platform == 'cygwin':
self._box.colon = '!'
def test_add_MM(self):
@@ -736,11 +737,13 @@ class _TestMboxMMDF(TestMailbox):
# In the parent, sleep a bit to give the child time to acquire
# the lock.
time.sleep(0.5)
- self.assertRaises(mailbox.ExternalClashError,
- self._box.lock)
+ try:
+ self.assertRaises(mailbox.ExternalClashError,
+ self._box.lock)
+ finally:
+ # Wait for child to exit. Locking should now succeed.
+ exited_pid, status = os.waitpid(pid, 0)
- # Wait for child to exit. Locking should now succeed.
- exited_pid, status = os.waitpid(pid, 0)
self._box.lock()
self._box.unlock()