From 1d928cbc7b2cfcf1ffd2ec27f83ee33f0af39dfe Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 8 Apr 2017 10:35:00 -0400 Subject: Use six to detect Python 2 --- setuptools/py27compat.py | 8 ++++---- 1 file 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 -- cgit v1.2.3