diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2016-07-27 18:09:09 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2017-10-12 17:05:32 +0200 |
commit | fc9b6e633d0132f62c8988fbd4413b4f71f24907 (patch) | |
tree | c52cd6ef673224420c629035dbc9a052191c6c74 /setup.py | |
parent | 8365272d598671b3b1d1eb12d94f6162a58e95e4 (diff) | |
download | m2crypto-fc9b6e633d0132f62c8988fbd4413b4f71f24907.tar.gz |
We should use special py3 option for swig when possible.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -33,6 +33,7 @@ log = logging.getLogger('setup') REQUIRED_SWIG_VERSION = '2.0.4' MAXIMUM_OPENSSL_VERSION = '1.0.1' + if sys.version_info[:2] <= (2, 6): # This covers hopefully only RHEL-6 (users of any other 2.6 Pythons # ... Solaris?, *BSD? ... should file an issue and be prepared to @@ -145,8 +146,11 @@ class _M2CryptoBuildExt(build_ext.build_ext): """Append custom openssl include file and library linking options.""" build_ext.build_ext.finalize_options(self) - if self.swig_opts is None: - self.swig_opts = [] + if not self.swig_opts: + if sys.version_info[:1] >= (3,): + self.swig_opts = ['-py3'] + else: + self.swig_opts = [] _openssl = next((x.split('=')[1] for x in sys.argv if '--openssl=' in x), None) |