commit 426b0a9cf04cf1712c7bd644ee6c1d74caf97917
parent 90894782ecfeaa2f9e61bca99146b1079e215cd7
Author: ng0 <ng0@n0.is>
Date: Tue, 29 Oct 2019 21:36:56 +0000
python is not always python3.
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/talerbuildconfig.py b/talerbuildconfig.py
@@ -234,10 +234,12 @@ class PythonTool(Tool):
def check(self, buildconfig):
# No suffix. Would probably be cheaper to do this in
# the dict as well. We need at least version 3.7.
- if existence("python"):
- if sys.version_info >= (3, 7):
- python3_version = sys.version[0:5]
- buildconfig._set_tool("python", "python", python3_version)
+ if existence("python") and (subprocess.check_output(["python", "--version"]).split()[1] >= b'3.7'):
+ # python might not be python3. It might not even be
+ # python 3.x.
+ python_version = subprocess.check_output(["python", "--version"]).split()[1]
+ if python_version >= b'3.7':
+ buildconfig._set_tool("python", "python", python_version)
return True
else:
# Has suffix, try suffix. We know the names in advance,