diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2017-01-07 13:37:37 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-01-07 13:37:37 -0500 |
commit | a0d35d47761a8bd7394cb9f2738169b07be3a005 (patch) | |
tree | 375334a5e61eb137b5411f92942b510f6024cea3 /setuptools/command/build_ext.py | |
parent | bbf6ac250a05fd51aa2a44ed3196837491bc9d60 (diff) | |
parent | 3c182f9f1eea89040fbfc88d1ccbed31ece6a00b (diff) | |
download | python-setuptools-git-issue-97.tar.gz |
Merge branch 'master' into issue-97issue-97
Diffstat (limited to 'setuptools/command/build_ext.py')
-rw-r--r-- | setuptools/command/build_ext.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py index 12dc88cd..36f53f0d 100644 --- a/setuptools/command/build_ext.py +++ b/setuptools/command/build_ext.py @@ -62,7 +62,7 @@ if_dl = lambda s: s if have_rtld else '' def get_abi3_suffix(): """Return the file extension for an abi3-compliant Extension()""" for suffix, _, _ in (s for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION): - if '.abi3' in suffix: # Unix + if '.abi3' in suffix: # Unix return suffix elif suffix == '.pyd': # Windows return suffix @@ -109,7 +109,7 @@ class build_ext(_build_ext): and get_abi3_suffix() ) if use_abi3: - so_ext = get_config_var('EXT_SUFFIX') + so_ext = _get_config_var_837('EXT_SUFFIX') filename = filename[:-len(so_ext)] filename = filename + get_abi3_suffix() if isinstance(ext, Library): @@ -316,3 +316,13 @@ else: self.create_static_lib( objects, basename, output_dir, debug, target_lang ) + + +def _get_config_var_837(name): + """ + In https://github.com/pypa/setuptools/pull/837, we discovered + Python 3.3.0 exposes the extension suffix under the name 'SO'. + """ + if sys.version_info < (3, 3, 1): + name = 'SO' + return get_config_var(name) |