home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / python / test_softspace.py < prev    next >
Encoding:
Python Source  |  2002-07-23  |  380 b   |  15 lines

  1. from test import test_support
  2. import StringIO
  3.  
  4. # SF bug 480215:  softspace confused in nested print
  5. f = StringIO.StringIO()
  6. class C:
  7.     def __str__(self):
  8.         print >> f, 'a'
  9.         return 'b'
  10.  
  11. print >> f, C(), 'c ', 'd\t', 'e'
  12. print >> f, 'f', 'g'
  13. # In 2.2 & earlier, this printed ' a\nbc  d\te\nf g\n'
  14. test_support.vereq(f.getvalue(), 'a\nb c  d\te\nf g\n')
  15.