diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-08-19 16:09:06 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-08-19 16:09:06 -0400 |
commit | 2cde914c7bc8c8e5a59f937317d47898b38426e4 (patch) | |
tree | e69dc16597d326c6552306122b6f4013a0089150 | |
parent | 097e92abaa7b72815a5eb9c232293ef4bbc1b626 (diff) | |
download | external_python_setuptools-2cde914c7bc8c8e5a59f937317d47898b38426e4.tar.gz external_python_setuptools-2cde914c7bc8c8e5a59f937317d47898b38426e4.tar.bz2 external_python_setuptools-2cde914c7bc8c8e5a59f937317d47898b38426e4.zip |
Use six for python major version detection
-rw-r--r-- | setuptools/tests/test_build_ext.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/setuptools/tests/test_build_ext.py b/setuptools/tests/test_build_ext.py index f2e1f59d..0edc92ec 100644 --- a/setuptools/tests/test_build_ext.py +++ b/setuptools/tests/test_build_ext.py @@ -1,7 +1,9 @@ import sys import distutils.command.build_ext as orig - from distutils.sysconfig import get_config_var + +from setuptools.extern import six + from setuptools.command.build_ext import build_ext, get_abi3_suffix from setuptools.dist import Distribution from setuptools.extension import Extension @@ -27,7 +29,7 @@ class TestBuildExt: of Python 3 if 'is_abi3' is truthy on Extension() """ print(get_abi3_suffix()) - + extension = Extension('spam.eggs', ['eggs.c'], py_limited_api=True) dist = Distribution(dict(ext_modules=[extension])) cmd = build_ext(dist) @@ -35,9 +37,9 @@ class TestBuildExt: assert 'spam.eggs' in cmd.ext_map res = cmd.get_ext_filename('spam.eggs') - if sys.version_info[0] == 2 or not get_abi3_suffix(): + if six.PY2 or not get_abi3_suffix(): assert res.endswith(get_config_var('SO')) elif sys.platform == 'win32': assert res.endswith('eggs.pyd') else: - assert 'abi3' in res
\ No newline at end of file + assert 'abi3' in res |