mirror of
https://github.com/python/cpython.git
synced 2025-10-24 07:26:11 +00:00
create_message(): When os.link() doesn't exist, make a copy of the msg
instead. Allows this test to finish on Windows again.
This commit is contained in:
parent
ffd674d400
commit
6626c1f183
1 changed files with 6 additions and 1 deletions
|
|
@ -49,7 +49,12 @@ class MaildirTestCase(unittest.TestCase):
|
||||||
self._msgfiles.append(tmpname)
|
self._msgfiles.append(tmpname)
|
||||||
fp.write(DUMMY_MESSAGE)
|
fp.write(DUMMY_MESSAGE)
|
||||||
fp.close()
|
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)
|
self._msgfiles.append(newname)
|
||||||
|
|
||||||
def test_empty_maildir(self):
|
def test_empty_maildir(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue