From: Tim Peters Date: Tue, 22 May 2001 16:29:01 +0000 (+0000) Subject: create_message(): When os.link() doesn't exist, make a copy of the msg X-Git-Tag: v2.2a3~1707 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6626c1f183e537e23cde9af84d4c7f9e235ef1b7;p=thirdparty%2FPython%2Fcpython.git create_message(): When os.link() doesn't exist, make a copy of the msg instead. Allows this test to finish on Windows again. --- diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index 98584593cf4c..b9887ca7e7dc 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):