diff options
author | ng0 <ng0@n0.is> | 2019-10-29 22:12:30 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-10-29 22:12:30 +0000 |
commit | 2536801927781ea38fefc3de924934e1c6a74d88 (patch) | |
tree | c310306bcd2476950616128425fac333a23fde2e /talerbuildconfig.py | |
parent | 426b0a9cf04cf1712c7bd644ee6c1d74caf97917 (diff) | |
download | build-common-2536801927781ea38fefc3de924934e1c6a74d88.tar.gz build-common-2536801927781ea38fefc3de924934e1c6a74d88.tar.bz2 build-common-2536801927781ea38fefc3de924934e1c6a74d88.zip |
use shlex.split()
Diffstat (limited to 'talerbuildconfig.py')
-rw-r--r-- | talerbuildconfig.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/talerbuildconfig.py b/talerbuildconfig.py index cdc5774..da063b9 100644 --- a/talerbuildconfig.py +++ b/talerbuildconfig.py @@ -23,6 +23,7 @@ from abc import ABC import argparse import os import sys +import shlex import logging from distutils.spawn import find_executable import subprocess @@ -234,11 +235,11 @@ 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") and (subprocess.check_output(["python", "--version"]).split()[1] >= b'3.7'): + if existence("python") and (shlex.split(subprocess.getstatusoutput("python --version")[1])[1] >= '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': + python_version = shlex.split(subprocess.getstatusoutput("python --version")[1])[1] + if python_version >= '3.7': buildconfig._set_tool("python", "python", python_version) return True else: |