1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-20 05:03:35 +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

View File

@@ -6,7 +6,6 @@ import os
from ebook_converter.utils.speedups import ReadOnlyFileBuffer
from ebook_converter.constants import ispy3
from ebook_converter.polyglot.builtins import string_or_bytes
HSIZE = 120
@@ -15,7 +14,7 @@ HSIZE = 120
def what(file, h=None):
' Recognize image headers '
if h is None:
if isinstance(file, string_or_bytes):
if isinstance(file, (str, bytes)):
with lopen(file, 'rb') as f:
h = f.read(HSIZE)
else: