osbuild: replace capture_output in subprocess.run

The `capture_output` argument for subprocess.run was added in 3.7,
but want to support 3.6 as well. Change all the usages of it with
`stdout=subprocess.PIPE` that will have the same effect, at least
for stdout.
This commit is contained in:
Christian Kellner 2020-06-08 23:14:26 +02:00 committed by David Rheinsberg
parent d7d1d9dbbf
commit 7a2ad6f0f8
3 changed files with 3 additions and 3 deletions

View file

@ -103,7 +103,7 @@ MEDIA_TYPES = {
def sha256sum(path: str) -> str:
ret = subprocess.run(["sha256sum", path],
capture_output=True,
stdout=subprocess.PIPE,
encoding="utf-8",
check=True)

View file

@ -78,7 +78,7 @@ class TestObjectStore(unittest.TestCase):
"tree",
"--print-only",
path],
capture_output=True)
stdout=subprocess.PIPE)
self.assertEqual(r.returncode, 0)
js = json.loads(r.stdout)

View file

@ -176,7 +176,7 @@ class TestBase(unittest.TestCase):
try:
r = subprocess.run(["rpm-ostree", "--version"],
encoding="utf-8",
capture_output=True,
stdout=subprocess.PIPE,
check=False)
except FileNotFoundError:
return False