From d9f56839e6b2e5dced5ef1ff7945766cd30e365a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 19 Dec 2019 08:18:56 +0530 Subject: [PATCH] Avoid creation of un-needed tuple --- src/calibre/prints.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/prints.py b/src/calibre/prints.py index 7f0870c546..fcbc52c418 100644 --- a/src/calibre/prints.py +++ b/src/calibre/prints.py @@ -25,11 +25,11 @@ def prints(*a, **kw): end = '\n' if is_binary(stream): encoding = getattr(stream, 'encoding', None) or 'utf-8' - a = tuple(as_bytes(x, encoding=encoding) for x in a) + a = (as_bytes(x, encoding=encoding) for x in a) sep = as_bytes(sep) end = as_bytes(end) else: - a = tuple(as_unicode(x, errors='replace') for x in a) + a = (as_unicode(x, errors='replace') for x in a) sep = as_unicode(sep) end = as_unicode(end) for x in a: