1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-07 13:33:33 +02:00

Removed check for python version

This commit is contained in:
2020-04-21 21:06:48 +02:00
parent 3234e4de27
commit de4f8a444b
21 changed files with 54 additions and 246 deletions

View File

@@ -7,7 +7,7 @@ import sys
from ebook_converter import CurrentDir, xml_replace_entities, prints
from ebook_converter.constants import (
filesystem_encoding, isbsd, islinux, isosx, ispy3, iswindows
filesystem_encoding, isbsd, islinux, isosx, iswindows
)
from ebook_converter.ebooks import ConversionError, DRMError
from ebook_converter.ebooks.chardet import xml_to_unicode
@@ -20,8 +20,6 @@ PDFTOHTML = 'pdftohtml'
def popen(cmd, **kw):
if not ispy3:
cmd = [x.encode(filesystem_encoding) if not isinstance(x, bytes) else x for x in cmd]
if iswindows:
kw['creationflags'] = 0x08
return subprocess.Popen(cmd, **kw)

View File

@@ -2,7 +2,6 @@ import codecs, zlib, numbers
from io import BytesIO
from datetime import datetime
from ebook_converter.constants import ispy3
from ebook_converter.utils.logging import default_log
from ebook_converter.polyglot.binary import as_hex_bytes
@@ -65,7 +64,7 @@ def serialize(o, stream):
# Must check bool before int as bools are subclasses of int
stream.write_raw(b'true' if o else b'false')
elif isinstance(o, numbers.Integral):
stream.write_raw(str(o).encode('ascii') if ispy3 else bytes(o))
stream.write_raw(str(o).encode('ascii'))
elif hasattr(o, 'pdf_serialize'):
o.pdf_serialize(stream)
elif o is None: