diff options
author | ng0 <ng0@n0.is> | 2019-10-29 21:36:56 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-10-29 21:36:56 +0000 |
commit | 426b0a9cf04cf1712c7bd644ee6c1d74caf97917 (patch) | |
tree | 3421785cedc69f4d9a368a6657b009e009320be1 | |
parent | 90894782ecfeaa2f9e61bca99146b1079e215cd7 (diff) | |
download | build-common-426b0a9cf04cf1712c7bd644ee6c1d74caf97917.tar.gz build-common-426b0a9cf04cf1712c7bd644ee6c1d74caf97917.tar.bz2 build-common-426b0a9cf04cf1712c7bd644ee6c1d74caf97917.zip |
python is not always python3.
-rw-r--r-- | talerbuildconfig.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/talerbuildconfig.py b/talerbuildconfig.py index ac3866e..cdc5774 100644 --- 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, |