summaryrefslogtreecommitdiff
path: root/setuptools
diff options
context:
space:
mode:
authorPaul Ganssle <pganssle@users.noreply.github.com>2018-07-20 12:11:53 -0400
committerGitHub <noreply@github.com>2018-07-20 12:11:53 -0400
commit5f510913b151998555034f70db0ceecc1e3a53b8 (patch)
treeff5d66caa52e8804536960532ec480a16905903b /setuptools
parentb48d4900233169c1143adfdd64aa00230ae13f26 (diff)
parent6e9ea31599c05df83501669def725b9e92b5b033 (diff)
downloadpython-setuptools-git-5f510913b151998555034f70db0ceecc1e3a53b8.tar.gz
Merge pull request #1416 from pganssle/use_six
Switch over to using six.PY{2,3} when possible
Diffstat (limited to 'setuptools')
-rw-r--r--setuptools/command/bdist_egg.py2
-rw-r--r--setuptools/extern/__init__.py2
-rw-r--r--setuptools/pep425tags.py6
3 files changed, 6 insertions, 4 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py
index 14530729..9f8df917 100644
--- a/setuptools/command/bdist_egg.py
+++ b/setuptools/command/bdist_egg.py
@@ -411,7 +411,7 @@ def scan_module(egg_dir, base, name, stubs):
return True # Extension module
pkg = base[len(egg_dir) + 1:].replace(os.sep, '.')
module = pkg + (pkg and '.' or '') + os.path.splitext(name)[0]
- if sys.version_info.major == 2:
+ if six.PY2:
skip = 8 # skip magic & date
elif sys.version_info < (3, 7):
skip = 12 # skip magic & date & file size
diff --git a/setuptools/extern/__init__.py b/setuptools/extern/__init__.py
index 52785a03..cb2fa329 100644
--- a/setuptools/extern/__init__.py
+++ b/setuptools/extern/__init__.py
@@ -48,7 +48,7 @@ class VendorImporter:
# on later Python versions to cause relative imports
# in the vendor package to resolve the same modules
# as those going through this importer.
- if sys.version_info.major >= 3:
+ if sys.version_info >= (3, ):
del sys.modules[extant]
return mod
except ImportError:
diff --git a/setuptools/pep425tags.py b/setuptools/pep425tags.py
index a86a0d18..8bf4277d 100644
--- a/setuptools/pep425tags.py
+++ b/setuptools/pep425tags.py
@@ -12,6 +12,8 @@ import sysconfig
import warnings
from collections import OrderedDict
+from .extern import six
+
from . import glibc
_osx_arch_pat = re.compile(r'(.+)_(\d+)_(\d+)_(.+)')
@@ -97,8 +99,8 @@ def get_abi_tag():
lambda: sys.maxunicode == 0x10ffff,
expected=4,
warn=(impl == 'cp' and
- sys.version_info.major == 2)) \
- and sys.version_info.major == 2:
+ six.PY2)) \
+ and six.PY2:
u = 'u'
abi = '%s%s%s%s%s' % (impl, get_impl_ver(), d, m, u)
elif soabi and soabi.startswith('cpython-'):