[Python-checkins] CVS: python/dist/src/Lib/test test_mailbox.py,1.4,1.5

Tim Peters tim_one@users.sourceforge.net
Tue, 22 May 2001 09:29:03 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv2774/python/dist/src/Lib/test

Modified Files:
	test_mailbox.py 
Log Message:
create_message():  When os.link() doesn't exist, make a copy of the msg
instead.  Allows this test to finish on Windows again.


Index: test_mailbox.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_mailbox.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** test_mailbox.py	2001/05/21 20:23:21	1.4
--- test_mailbox.py	2001/05/22 16:29:01	1.5
***************
*** 50,54 ****
          fp.write(DUMMY_MESSAGE)
          fp.close()
!         os.link(tmpname, newname)
          self._msgfiles.append(newname)
  
--- 50,59 ----
          fp.write(DUMMY_MESSAGE)
          fp.close()
!         if hasattr(os, "link"):
!             os.link(tmpname, newname)
!         else:
!             fp = open(newname, "w")
!             fp.write(DUMMY_MESSAGE)
!             fp.close()
          self._msgfiles.append(newname)