summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2016-07-27 18:09:09 +0200
committerMatěj Cepl <mcepl@cepl.eu>2017-10-12 17:05:32 +0200
commitfc9b6e633d0132f62c8988fbd4413b4f71f24907 (patch)
treec52cd6ef673224420c629035dbc9a052191c6c74 /setup.py
parent8365272d598671b3b1d1eb12d94f6162a58e95e4 (diff)
downloadm2crypto-fc9b6e633d0132f62c8988fbd4413b4f71f24907.tar.gz
We should use special py3 option for swig when possible.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 6b8713e..bfae544 100644
--- a/setup.py
+++ b/setup.py
@@ -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)