summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-05-22 16:29:01 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-05-22 16:29:01 (GMT)
commit6626c1f183e537e23cde9af84d4c7f9e235ef1b7 (patch)
treeab09dbdb597224d06addcdd21369d187f07a50a9 /Lib/test
parentffd674d400bb56c2bde1f75b90d2ad2ab880b4a4 (diff)
downloadcpython-6626c1f183e537e23cde9af84d4c7f9e235ef1b7.zip
cpython-6626c1f183e537e23cde9af84d4c7f9e235ef1b7.tar.gz
cpython-6626c1f183e537e23cde9af84d4c7f9e235ef1b7.tar.bz2
create_message(): When os.link() doesn't exist, make a copy of the msg
instead. Allows this test to finish on Windows again.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_mailbox.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 9858459..b9887ca 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -49,7 +49,12 @@ class MaildirTestCase(unittest.TestCase):
self._msgfiles.append(tmpname)
fp.write(DUMMY_MESSAGE)
fp.close()
- os.link(tmpname, newname)
+ if hasattr(os, "link"):
+ os.link(tmpname, newname)
+ else:
+ fp = open(newname, "w")
+ fp.write(DUMMY_MESSAGE)
+ fp.close()
self._msgfiles.append(newname)
def test_empty_maildir(self):