diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-08-16 00:29:24 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-08-16 07:15:18 -0400 |
commit | fb7ab81a3d080422687bad71f9ae9d36eeefbee2 (patch) | |
tree | d87a9f6fdf32ab64334e1eb8a695949a88a3b043 /setuptools/command/build_ext.py | |
parent | 4eb5b32f8d8bb1e20907028a516346e2b1901391 (diff) | |
download | python-setuptools-git-fb7ab81a3d080422687bad71f9ae9d36eeefbee2.tar.gz |
Remove Python 2 compatibility
Diffstat (limited to 'setuptools/command/build_ext.py')
-rw-r--r-- | setuptools/command/build_ext.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py index 89a0e328..03a72b4f 100644 --- a/setuptools/command/build_ext.py +++ b/setuptools/command/build_ext.py @@ -1,6 +1,7 @@ import os import sys import itertools +from importlib.machinery import EXTENSION_SUFFIXES from distutils.command.build_ext import build_ext as _du_build_ext from distutils.file_util import copy_file from distutils.ccompiler import new_compiler @@ -9,15 +10,6 @@ from distutils.errors import DistutilsError from distutils import log from setuptools.extension import Library -from setuptools.extern import six - -if six.PY2: - import imp - - EXTENSION_SUFFIXES = [ - s for s, _, tp in imp.get_suffixes() if tp == imp.C_EXTENSION] -else: - from importlib.machinery import EXTENSION_SUFFIXES try: # Attempt to use Cython for building extensions, if available @@ -115,11 +107,7 @@ class build_ext(_build_ext): filename = _build_ext.get_ext_filename(self, fullname) if fullname in self.ext_map: ext = self.ext_map[fullname] - use_abi3 = ( - not six.PY2 - and getattr(ext, 'py_limited_api') - and get_abi3_suffix() - ) + use_abi3 = getattr(ext, 'py_limited_api') and get_abi3_suffix() if use_abi3: so_ext = get_config_var('EXT_SUFFIX') filename = filename[:-len(so_ext)] |