Clean up compat and fix is_pypy.

This commit is contained in:
Jakub Roztocil 2015-02-24 08:18:03 +01:00
parent 1c181a5d25
commit fdae686e12

View File

@ -5,13 +5,11 @@ Python 2.6, 2.7, and 3.x compatibility.
import sys
# Taken from `requests.compat`
_ver = sys.version_info
is_py2 = (_ver[0] == 2)
is_py26 = (is_py2 and _ver[1] == 6)
is_py27 = (is_py2 and _ver[1] == 7)
is_py3 = (_ver[0] == 3)
is_pypy = ('pypy' in _ver)
is_py2 = sys.version_info[0] == 2
is_py26 = sys.version_info[:2] == (2, 6)
is_py27 = sys.version_info[:2] == (2, 7)
is_py3 = sys.version_info[0] == 3
is_pypy = 'pypy' in sys.version.lower()
is_windows = 'win32' in str(sys.platform).lower()