Minor fixups for changes when removing py3 conditionals

This commit is contained in:
Kovid Goyal 2019-11-18 14:30:48 +05:30
parent 764e8bff7e
commit 520c46dfb9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 19 additions and 13 deletions

View File

@ -769,16 +769,6 @@
}
},
{
"name": "enum34",
"python": "<3",
"unix": {
"filename": "enum34-1.1.6.tar.gz",
"hash": "sha256:8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1",
"urls": ["pypi"]
}
},
{
"name": "sip",
"unix": {

View File

@ -218,8 +218,8 @@ def init_env():
class Build(Command):
short_description = 'Build calibre C/C++ extension modules'
DEFAULT_OUTPUTDIR = os.path.abspath(os.path.join(SRC, 'calibre', 'plugins', sys.version_info.major))
DEFAULT_BUILDDIR = os.path.abspath(os.path.join(os.path.dirname(SRC), 'build', sys.version_info.major))
DEFAULT_OUTPUTDIR = os.path.abspath(os.path.join(SRC, 'calibre', 'plugins', str(sys.version_info.major)))
DEFAULT_BUILDDIR = os.path.abspath(os.path.join(os.path.dirname(SRC), 'build', str(sys.version_info.major)))
description = textwrap.dedent('''\
calibre depends on several python extensions written in C/C++.

View File

@ -150,7 +150,7 @@ def cache_dir():
return ans
plugins_loc = os.path.join(sys.extensions_location, sys.version_info.major)
plugins_loc = os.path.join(sys.extensions_location, str(sys.version_info.major))
# plugins {{{

View File

@ -121,3 +121,19 @@ def int_to_byte(x):
def reload(module):
import importlib
return importlib.reload(module)
def print_to_binary_file(fileobj, encoding='utf-8'):
def print(*a, **kw):
f = kw.get('file', fileobj)
if a:
sep = as_bytes(kw.get('sep', ' '), encoding)
for x in a:
x = as_bytes(x, encoding)
f.write(x)
if x is not a[-1]:
f.write(sep)
f.write(as_bytes(kw.get('end', '\n')))
return print