From 7c98c1aea165bbe569caeaf625e6062c6fd778e8 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 25 May 2015 09:56:43 -0700 Subject: [PATCH] Fix print_ with no args (close #1478) --- beets/ui/__init__.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index fd09a9a06..5a5343157 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -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):