Skip to content
Snippets Groups Projects
Commit 87819502 authored by Samuel John's avatar Samuel John
Browse files

Python: Don't use named tuples to get the version

sys.version_info.major is only possible on 2.7+ or so.
Therefore, we now use [0] instead.
parent 623b21a7
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,7 @@ class PythonInstalled < Requirement
elsif version < @min_version
@unsatisfied_because += "Python version #{version} is too old (need at least #{@min_version})."
false
elsif @min_version.major == 2 && `python -c "import sys; print(sys.version_info.major)"`.strip == "3"
elsif @min_version.major == 2 && `python -c "import sys; print(sys.version_info[0])"`.strip == "3"
@unsatisfied_because += "Your `python` points to a Python 3.x. This is not supported."
false
else
......@@ -240,7 +240,7 @@ class PythonInstalled < Requirement
# Don't print from here, or else universe will collapse.
import sys
if sys.version_info.major == #{version.major} and sys.version_info.minor == #{version.minor}:
if sys.version_info[0] == #{version.major} and sys.version_info[1] == #{version.minor}:
if sys.executable.startswith('#{HOMEBREW_PREFIX}'):
# Fix 1)
# A setuptools.pth and/or easy-install.pth sitting either in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment