[Python-checkins] CVS: python/dist/src/Lib doctest.py,1.6,1.7

Tim Peters tim_one@users.sourceforge.net
Tue, 13 Feb 2001 22:35:37 -0800


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

Modified Files:
	doctest.py 
Log Message:
Miranda newlines:  if anything at all was written to stdout, supply a
newline at the end if there isn't one already.  Expected output has no
way to indicate that a trailing newline was not expected, and in the
interpreter shell *Python* supplies the trailing newline before printing
the next prompt.


Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** doctest.py	2001/02/14 00:43:21	1.6
--- doctest.py	2001/02/14 06:35:35	1.7
***************
*** 445,449 ****
          self.buf.append(s)
      def get(self):
!         return "".join(self.buf)
      def clear(self):
          self.buf = []
--- 445,455 ----
          self.buf.append(s)
      def get(self):
!         guts = "".join(self.buf)
!         # If anything at all was written, make sure there's a trailing
!         # newline.  There's no way for the expected output to indicate
!         # that a trailing newline is missing.
!         if guts and not guts.endswith("\n"):
!             guts = guts + "\n"
!         return guts
      def clear(self):
          self.buf = []