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)
master
Huangbin Zhan 4 years ago committed by Daniel Golle
parent 78f57fbce6
commit 9c0ad7f1d5
  1. 7
      scripts/json_overview_image_info.py

@ -2,7 +2,7 @@
from os import getenv, environ from os import getenv, environ
from pathlib import Path from pathlib import Path
from subprocess import run from subprocess import run, PIPE
from sys import argv from sys import argv
import json import json
@ -42,10 +42,11 @@ if output:
"val.DEFAULT_PACKAGES", "val.DEFAULT_PACKAGES",
"val.ARCH_PACKAGES", "val.ARCH_PACKAGES",
], ],
capture_output=True, stdout=PIPE,
stderr=PIPE,
check=True, check=True,
env=environ.copy().update({"TOPDIR": Path().cwd()}), env=environ.copy().update({"TOPDIR": Path().cwd()}),
text=True, universal_newlines=True,
).stdout.splitlines() ).stdout.splitlines()
output["default_packages"] = default_packages.split() output["default_packages"] = default_packages.split()

Loading…
Cancel
Save