1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-23 22:51:30 +02:00

Removing couple of "buildins" polyglot types

This commit is contained in:
2020-04-20 20:22:50 +02:00
parent eac0b98d6f
commit c867f0321b
36 changed files with 85 additions and 109 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import re
from ebook_converter import force_unicode
from ebook_converter.ebooks.metadata import MetaInformation
from ebook_converter.polyglot.builtins import string_or_bytes, int_to_byte
from ebook_converter.polyglot.builtins import int_to_byte
title_pat = re.compile(br'\{\\info.*?\{\\title(.*?)(?<!\\)\}', re.DOTALL)
author_pat = re.compile(br'\{\\info.*?\{\\author(.*?)(?<!\\)\}', re.DOTALL)
@@ -156,7 +156,7 @@ def create_metadata(stream, options):
md.append(r'{\title %s}'%(title,))
if options.authors:
au = options.authors
if not isinstance(au, string_or_bytes):
if not isinstance(au, (str, bytes)):
au = ', '.join(au)
author = encode(au)
md.append(r'{\author %s}'%(author,))