This commit is contained in:
Kovid Goyal 2019-03-26 08:24:12 +05:30
parent f66d6f9fcf
commit f68c1f2672
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -14,10 +14,11 @@
isunix = islinux or isosx or isbsd or ishaiku
py_lib = os.path.join(sys.prefix, 'libs', 'python%d%d.lib' % sys.version_info[:2])
ispy3 = sys.version_info.major > 2
def init_symbol_name(name):
prefix = 'PyInit_' if sys.version_info.major > 2 else 'init'
prefix = 'PyInit_' if ispy3 else 'init'
return prefix + name
@ -44,7 +45,7 @@ def __init__(self, name, sources, **kwargs):
if iswindows:
self.cflags.append('/DCALIBRE_MODINIT_FUNC=PyMODINIT_FUNC')
else:
return_type = 'PyObject*' if sys.version_info >= (3,) else 'void'
return_type = 'PyObject*' if ispy3 else 'void'
extern_decl = 'extern "C"' if self.needs_cxx else ''
self.cflags.append(
@ -268,7 +269,7 @@ def run(self, opts):
for ext in extensions:
if opts.only != 'all' and opts.only != ext.name:
continue
if ext.needs_py2 and sys.version_info >= (3,):
if ext.needs_py2 and ispy3:
continue
if ext.error:
if ext.optional: