summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-02-11 15:05:03 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-02-11 15:05:03 (GMT)
commit0b61d3c0f2a818355e6bfcbf79c4f47875c10b15 (patch)
tree1addd11f449a4e91b9977fccfbd4f85d4832a1c3
parentb71b8ec7b1d3ae8eb4f446387f766aea7d7d831b (diff)
parentb3e8384cbef09c59f593b518f689462add481679 (diff)
downloadcpython-0b61d3c0f2a818355e6bfcbf79c4f47875c10b15.zip
cpython-0b61d3c0f2a818355e6bfcbf79c4f47875c10b15.tar.gz
cpython-0b61d3c0f2a818355e6bfcbf79c4f47875c10b15.tar.bz2
Merge: #17064: fix sporadic permission errors in test_mailbox on windows.
Patch by Jeremy Kloth.
-rw-r--r--Lib/test/test_mailbox.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 6b1e933..39e8643 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -43,9 +43,9 @@ class TestBase:
def _delete_recursively(self, target):
# Delete a file or delete a directory recursively
if os.path.isdir(target):
- shutil.rmtree(target)
+ support.rmtree(target)
elif os.path.exists(target):
- os.remove(target)
+ support.unlink(target)
class TestMailbox(TestBase):
@@ -2112,9 +2112,9 @@ class MaildirTestCase(unittest.TestCase):
# create a new maildir mailbox to work with:
self._dir = support.TESTFN
if os.path.isdir(self._dir):
- shutil.rmtree(self._dir)
+ support.rmtree(self._dir)
elif os.path.isfile(self._dir):
- os.unlink(self._dir)
+ support.unlink(self._dir)
os.mkdir(self._dir)
os.mkdir(os.path.join(self._dir, "cur"))
os.mkdir(os.path.join(self._dir, "tmp"))
@@ -2124,10 +2124,10 @@ class MaildirTestCase(unittest.TestCase):
def tearDown(self):
list(map(os.unlink, self._msgfiles))
- os.rmdir(os.path.join(self._dir, "cur"))
- os.rmdir(os.path.join(self._dir, "tmp"))
- os.rmdir(os.path.join(self._dir, "new"))
- os.rmdir(self._dir)
+ support.rmdir(os.path.join(self._dir, "cur"))
+ support.rmdir(os.path.join(self._dir, "tmp"))
+ support.rmdir(os.path.join(self._dir, "new"))
+ support.rmdir(self._dir)
def createMessage(self, dir, mbox=False):
t = int(time.time() % 1000000)