[Python-checkins] r51202 - in python/trunk: Lib/test/test_mailbox.py Misc/NEWS

neal.norwitz python-checkins at python.org
Fri Aug 11 08:09:43 CEST 2006


Author: neal.norwitz
Date: Fri Aug 11 08:09:41 2006
New Revision: 51202
Modified:
 python/trunk/Lib/test/test_mailbox.py
 python/trunk/Misc/NEWS
Log:
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.
Modified: python/trunk/Lib/test/test_mailbox.py
==============================================================================
--- python/trunk/Lib/test/test_mailbox.py	(original)
+++ python/trunk/Lib/test/test_mailbox.py	Fri Aug 11 08:09:41 2006
@@ -1,4 +1,5 @@
 import os
+import sys
 import time
 import stat
 import socket
@@ -461,7 +462,7 @@
 
 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 @@
 # 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()
 
Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Fri Aug 11 08:09:41 2006
@@ -58,6 +58,8 @@
 Tests
 -----
 
+- test_mailbox should now work on cygwin versions 2006年08月10日 and later.
+
 - Bug #1535182: really test the xreadlines() method of bz2 objects.
 
 - test_threading now skips testing alternate thread stack sizes on


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /