aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/py27compat.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-04-08 10:35:00 -0400
committerJason R. Coombs <jaraco@jaraco.com>2017-04-08 10:35:00 -0400
commit1d928cbc7b2cfcf1ffd2ec27f83ee33f0af39dfe (patch)
tree0d715ea49fcb89c0ff004bc0e7c09b9e6f58aa13 /setuptools/py27compat.py
parentc86965048dee300bc4d985afc72e5de7267658b3 (diff)
downloadexternal_python_setuptools-1d928cbc7b2cfcf1ffd2ec27f83ee33f0af39dfe.tar.gz
external_python_setuptools-1d928cbc7b2cfcf1ffd2ec27f83ee33f0af39dfe.tar.bz2
external_python_setuptools-1d928cbc7b2cfcf1ffd2ec27f83ee33f0af39dfe.zip
Use six to detect Python 2
Diffstat (limited to 'setuptools/py27compat.py')
-rw-r--r--setuptools/py27compat.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/setuptools/py27compat.py b/setuptools/py27compat.py
index 4b6fae91..701283c8 100644
--- a/setuptools/py27compat.py
+++ b/setuptools/py27compat.py
@@ -2,9 +2,10 @@
Compatibility Support for Python 2.7 and earlier
"""
-import sys
import platform
+import six
+
def get_all_headers(message, key):
"""
@@ -13,15 +14,14 @@ def get_all_headers(message, key):
return message.get_all(key)
-if sys.version_info < (3,):
-
+if six.PY2:
def get_all_headers(message, key):
return message.getheaders(key)
linux_py2_ascii = (
platform.system() == 'Linux' and
- sys.version_info < (3,)
+ six.PY2
)
rmtree_safe = str if linux_py2_ascii else lambda x: x