python: Conditionally provide py3 argument to SWIG
* lang/python/setup.py.in: Only call with -py3 when we run under python3 or higher. -- If we ever remove the -builtin flag and leave the the -py3 flag, SWIG will generate Python code which will be incompatible with Python 2, because the py3 flag generates python3 code which is incompatible with python2. So we conditionally generate SWIG bindings with -py3. Signed-off-by: Tobias Mueller <muelli@cryptobitch.de>
This commit is contained in:
parent
fe65a26ab5
commit
d184dbbba8
@ -152,9 +152,10 @@ class BuildExtFirstHack(build):
|
|||||||
self.run_command('build_ext')
|
self.run_command('build_ext')
|
||||||
build.run(self)
|
build.run(self)
|
||||||
|
|
||||||
|
py3 = [] if sys.version_info.major < 3 else ['-py3']
|
||||||
swige = Extension("gpg._gpgme", ["gpgme.i", "helpers.c"],
|
swige = Extension("gpg._gpgme", ["gpgme.i", "helpers.c"],
|
||||||
swig_opts = ['-py3', '-builtin', '-threads',
|
swig_opts = ['-threads', '-builtin',
|
||||||
'-outdir', 'gpg'] + extra_swig_opts,
|
'-outdir', 'gpg'] + py3 + extra_swig_opts,
|
||||||
include_dirs = include_dirs,
|
include_dirs = include_dirs,
|
||||||
define_macros = define_macros,
|
define_macros = define_macros,
|
||||||
library_dirs = library_dirs,
|
library_dirs = library_dirs,
|
||||||
|
Loading…
Reference in New Issue
Block a user