Skip to content

Commit 5cf87aa

Browse files
committed
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.
1 parent cbe99a1 commit 5cf87aa

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Lib/test/test_mailbox.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
import os
33
import test_support
44

5+
# cleanup the turds of some of the other tests. :(
6+
try:
7+
os.unlink(test_support.TESTFN)
8+
except OSError:
9+
pass
10+
511
# create a new maildir mailbox to work with:
612
curdir = os.path.join(test_support.TESTFN, "cur")
713
newdir = os.path.join(test_support.TESTFN, "new")
@@ -21,8 +27,8 @@
2127

2228
finally:
2329
try: os.rmdir(newdir)
24-
except IOError: pass
30+
except OSError: pass
2531
try: os.rmdir(curdir)
26-
except IOError: pass
32+
except OSError: pass
2733
try: os.rmdir(test_support.TESTFN)
28-
except IOError: pass
34+
except OSError: pass

0 commit comments

Comments
 (0)