mirror of
https://github.com/python/cpython.git
synced 2025-11-09 06:01:05 +00:00
There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
14 lines
375 B
Python
14 lines
375 B
Python
from test import test_support
|
|
import StringIO
|
|
|
|
# SF bug 480215: softspace confused in nested print
|
|
f = StringIO.StringIO()
|
|
class C:
|
|
def __str__(self):
|
|
print('a', file=f)
|
|
return 'b'
|
|
|
|
print(C(), 'c ', 'd\t', 'e', file=f)
|
|
print('f', 'g', file=f)
|
|
# In 2.2 & earlier, this printed ' a\nbc d\te\nf g\n'
|
|
test_support.vereq(f.getvalue(), 'a\nb c d\te\nf g\n')
|