[Python-checkins] CVS: python/dist/src/Lib multifile.py,1.19,1.20

Guido van Rossum gvanrossum@users.sourceforge.net
Fri, 05 Oct 2001 14:22:23 -0700


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

Modified Files:
	multifile.py 
Log Message:
Martijn Pieters convinced me that when readline() strips the trailing
newline from a multifile part, it should also strip a trailing \r\n.


Index: multifile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/multifile.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** multifile.py	2001/09/18 14:34:06	1.19
--- multifile.py	2001/10/05 21:22:21	1.20
***************
*** 77,82 ****
          if line:
              self.readahead = self._readline()
!             if not self.readahead and line[-1:] == "\n":
!                 line = line[:-1]
          return line
  
--- 77,85 ----
          if line:
              self.readahead = self._readline()
!             if not self.readahead:
!                 if line[-2:] == "\r\n":
!                     line = line[:-2]
!                 elif line[-1:] == "\n":
!                     line = line[:-1]
          return line