diff options
author | Huangbin Zhan <zhanhb88@gmail.com> | 2020-07-07 07:14:42 +0800 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2020-07-13 21:24:30 +0100 |
commit | 9c0ad7f1d5e564420ae1e6493c2fc2622fd27c8c (patch) | |
tree | 4d79d6de6d83f773a54587ad783c40ca643198e1 | |
parent | 78f57fbce61ca26a04d2fcab4887228290ee2303 (diff) | |
download | upstream-9c0ad7f1d5e564420ae1e6493c2fc2622fd27c8c.tar.gz upstream-9c0ad7f1d5e564420ae1e6493c2fc2622fd27c8c.tar.bz2 upstream-9c0ad7f1d5e564420ae1e6493c2fc2622fd27c8c.zip |
build: fix compatibility with python 3.6
On a system python3 is linked to python3.6, fail to perform json_overview_image_info
and got `TypeError: __init__() got an unexpected keyword argument 'capture_output'`.
This patch emulate the behaviour on python 3.7+.
Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
(cherry picked from commit 3caad5150c2011a7dac462acaa06d0e69f8ed005)
-rwxr-xr-x | scripts/json_overview_image_info.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py index 8f3525f890..c76a442840 100755 --- a/scripts/json_overview_image_info.py +++ b/scripts/json_overview_image_info.py @@ -2,7 +2,7 @@ from os import getenv, environ from pathlib import Path -from subprocess import run +from subprocess import run, PIPE from sys import argv import json @@ -42,10 +42,11 @@ if output: "val.DEFAULT_PACKAGES", "val.ARCH_PACKAGES", ], - capture_output=True, + stdout=PIPE, + stderr=PIPE, check=True, env=environ.copy().update({"TOPDIR": Path().cwd()}), - text=True, + universal_newlines=True, ).stdout.splitlines() output["default_packages"] = default_packages.split() |