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

@@ -10,7 +10,7 @@ from tempfile import SpooledTemporaryFile
from ebook_converter import sanitize_file_name
from ebook_converter.constants import filesystem_encoding
from ebook_converter.ebooks.chardet import detect
from ebook_converter.polyglot.builtins import string_or_bytes, getcwd, as_bytes
from ebook_converter.polyglot.builtins import getcwd, as_bytes
try:
import zlib # We may need its compression method
@@ -749,7 +749,7 @@ class ZipFile:
self.comment = b''
# Check if we were passed a file-like object
if isinstance(file, string_or_bytes):
if isinstance(file, (str, bytes)):
self._filePassed = 0
self.filename = file
modeDict = {'r' : 'rb', 'w': 'wb', 'a' : 'r+b'}