build-common

Shared build system code (usually as a git submodule)
Log | Files | Refs | README | LICENSE

commit 2536801927781ea38fefc3de924934e1c6a74d88
parent 426b0a9cf04cf1712c7bd644ee6c1d74caf97917
Author: ng0 <ng0@n0.is>
Date:   Tue, 29 Oct 2019 22:12:30 +0000

use shlex.split()

Diffstat:
Mtalerbuildconfig.py | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 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: