Fix print_ with no args (close #1478)

This commit is contained in:
Adrian Sampson 2015-05-25 09:56:43 -07:00
parent c93d5ce25b
commit 7c98c1aea1

View file

@ -123,15 +123,12 @@ def print_(*strings, **kwargs):
"""
end = kwargs.get('end')
if strings:
if isinstance(strings[0], unicode):
txt = u' '.join(strings)
txt += u'\n' if end is None else end
else:
txt = b' '.join(strings)
txt += b'\n' if end is None else end
if not strings or isinstance(strings[0], unicode):
txt = u' '.join(strings)
txt += u'\n' if end is None else end
else:
txt = u''
txt = b' '.join(strings)
txt += b'\n' if end is None else end
# Always send bytes to the stdout stream.
if isinstance(txt, unicode):