diff options
author | Barry Warsaw <barry@python.org> | 2001-06-04 19:35:04 +0000 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2001-06-04 19:35:04 +0000 |
commit | a5e5cede693ef6604918cd8c944a857b763699ad (patch) | |
tree | f18670aee9d519a21a8f2e61ed728cc00e4a4e10 | |
parent | 20cf059964a1ce2e36581c89e6512d53c1cfe0d4 (diff) | |
download | cpython-a5e5cede693ef6604918cd8c944a857b763699ad.tar.gz |
Backported two fixes from the Py2.1 tree (pre-unittest rewrite):
----------------------------
revision 1.3
date: 2001/04/10 15:01:20; author: gvanrossum; state: Exp; lines: +6 -0
Some other tests, when failing, don't always remove their TESTFN file.
Try to do it for them, so our mkdir() operation doesn't fail.
----------------------------
revision 1.2
date: 2001/03/02 05:46:17; author: gvanrossum; state: Exp; lines: +3 -3
When catching errors from os.rmdir(), test for os.error, not IOError!
----------------------------
except I used OSError instead of os.error.
-rw-r--r-- | Lib/test/test_mailbox.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index e28d721f0a..a19c15b048 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -2,6 +2,12 @@ import mailbox import os import test_support +# cleanup the turds of some of the other tests. :( +try: + os.unlink(test_support.TESTFN) +except OSError: + pass + # create a new maildir mailbox to work with: curdir = os.path.join(test_support.TESTFN, "cur") newdir = os.path.join(test_support.TESTFN, "new") @@ -21,8 +27,8 @@ try: finally: try: os.rmdir(newdir) - except IOError: pass + except OSError: pass try: os.rmdir(curdir) - except IOError: pass + except OSError: pass try: os.rmdir(test_support.TESTFN) - except IOError: pass + except OSError: pass |