mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-04 22:03:37 +02:00
py3: Fix prints()
This commit is contained in:
parent
86ffa4f717
commit
4775fc780c
1 changed files with 6 additions and 2 deletions
|
|
@ -158,9 +158,13 @@ def prints(*args, **kwargs):
|
|||
'''
|
||||
file = kwargs.get('file', sys.stdout)
|
||||
file = getattr(file, 'buffer', file)
|
||||
sep = bytes(kwargs.get('sep', ' '))
|
||||
end = bytes(kwargs.get('end', '\n'))
|
||||
enc = 'utf-8' if 'CALIBRE_WORKER' in os.environ else preferred_encoding
|
||||
sep = kwargs.get('sep', ' ')
|
||||
if not isinstance(sep, bytes):
|
||||
sep = sep.encode(enc)
|
||||
end = kwargs.get('end', '\n')
|
||||
if not isinstance(end, bytes):
|
||||
end = end.encode(enc)
|
||||
safe_encode = kwargs.get('safe_encode', False)
|
||||
count = 0
|
||||
for i, arg in enumerate(args):
|
||||
|
|
|
|||
Loading…
Reference in a new issue