From 1caa2ceafa7bc321a79dedc43d671bef8eec5d66 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 23 Jan 2017 01:08:23 +0100 Subject: [PATCH] Cannot use sys.version.major and minor names, because in Python 2.6 it's not a namedtuple. --- jedi/_compatibility.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/jedi/_compatibility.py b/jedi/_compatibility.py index 4bfb1d7a..ebce85aa 100644 --- a/jedi/_compatibility.py +++ b/jedi/_compatibility.py @@ -12,12 +12,14 @@ try: except ImportError: pass -is_py3 = sys.version_info.major >= 3 -is_py33 = is_py3 and sys.version_info.minor >= 3 -is_py34 = is_py3 and sys.version_info.minor >= 4 -is_py35 = is_py3 and sys.version_info.minor >= 5 +# Cannot use sys.version.major and minor names, because in Python 2.6 it's not +# a namedtuple. +is_py3 = sys.version_info[0] >= 3 +is_py33 = is_py3 and sys.version_info[1] >= 3 +is_py34 = is_py3 and sys.version_info[1] >= 4 +is_py35 = is_py3 and sys.version_info[1] >= 5 is_py26 = not is_py3 and sys.version_info[1] < 7 -py_version = int(str(sys.version_info.major) + str(sys.version_info.minor)) +py_version = int(str(sys.version_info[0]) + str(sys.version_info[1])) class DummyFile(object):