[Python-checkins] CVS: python/dist/src/Lib/test test_pty.py,1.12,1.12.2.1

Anthony Baxter anthonybaxter@users.sourceforge.net
Thu, 10 Jan 2002 07:51:54 -0800


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

Modified Files:
      Tag: release21-maint
	test_pty.py 
Log Message:
backport 1.14:
  Fix the second reincarnation of SF #456395 -- failure on IRIX.  This
  time use .replace() to change all \r\n into \n, not just the last one.

This makes test_pty work on Irix.



Index: test_pty.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pty.py,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -C2 -d -r1.12 -r1.12.2.1
*** test_pty.py	2001/03/29 04:36:09	1.12
--- test_pty.py	2002/01/10 15:51:52	1.12.2.1
***************
*** 35,41 ****
  os.write(slave_fd, TEST_STRING_1)
  s1 = os.read(master_fd, 1024)
! if s1[-2:] == "\r\n":
!     s1 = s1[:-2] + "\n"
! sys.stdout.write(s1)
  
  debug("Writing chunked output")
--- 35,39 ----
  os.write(slave_fd, TEST_STRING_1)
  s1 = os.read(master_fd, 1024)
! sys.stdout.write(s1.replace("\r\n", "\n"))
  
  debug("Writing chunked output")
***************
*** 43,49 ****
  os.write(slave_fd, TEST_STRING_2[5:])
  s2 = os.read(master_fd, 1024)
! if s2[-2:] == "\r\n":
!     s2 = s2[:-2] + "\n"
! sys.stdout.write(s2)
  
  os.close(slave_fd)
--- 41,45 ----
  os.write(slave_fd, TEST_STRING_2[5:])
  s2 = os.read(master_fd, 1024)
! sys.stdout.write(s2.replace("\r\n", "\n"))
  
  os.close(slave_fd)