mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 20:35:18 +02:00
Use builtin zlib in py3
This commit is contained in:
parent
40e61a8952
commit
8b9e401f32
2 changed files with 10 additions and 7 deletions
|
|
@ -31,7 +31,8 @@
|
|||
"inc_dirs": "!zlib_inc_dirs",
|
||||
"lib_dirs": "!zlib_lib_dirs",
|
||||
"libraries": "z",
|
||||
"windows_libraries": "zlib"
|
||||
"windows_libraries": "zlib",
|
||||
"needs_py2": true
|
||||
},
|
||||
{
|
||||
"name": "certgen",
|
||||
|
|
|
|||
|
|
@ -12,9 +12,8 @@
|
|||
from itertools import chain, repeat, izip_longest
|
||||
from operator import itemgetter
|
||||
from functools import wraps
|
||||
from polyglot.builtins import map
|
||||
|
||||
from polyglot.builtins import reraise
|
||||
from polyglot.builtins import reraise, map, is_py3
|
||||
|
||||
from calibre import guess_type, force_unicode
|
||||
from calibre.constants import __version__, plugins
|
||||
|
|
@ -31,10 +30,13 @@
|
|||
Range = namedtuple('Range', 'start stop size')
|
||||
MULTIPART_SEPARATOR = uuid.uuid4().hex.decode('ascii')
|
||||
COMPRESSIBLE_TYPES = {'application/json', 'application/javascript', 'application/xml', 'application/oebps-package+xml'}
|
||||
zlib, zlib2_err = plugins['zlib2']
|
||||
if zlib2_err:
|
||||
raise RuntimeError('Failed to laod the zlib2 module with error: ' + zlib2_err)
|
||||
del zlib2_err
|
||||
if is_py3:
|
||||
import zlib
|
||||
else:
|
||||
zlib, zlib2_err = plugins['zlib2']
|
||||
if zlib2_err:
|
||||
raise RuntimeError('Failed to load the zlib2 module with error: ' + zlib2_err)
|
||||
del zlib2_err
|
||||
|
||||
|
||||
def header_list_to_file(buf): # {{{
|
||||
|
|
|
|||
Loading…
Reference in a new issue