[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/45] tests/docker: handle missing encoding keyword
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PULL 05/45] tests/docker: handle missing encoding keyword for subprocess.check_output |
Date: |
Tue, 10 Sep 2019 09:43:09 +0100 |
This was only added in Python 3.6 and not all the build hosts have
that recent a python3. However we still need to ensure everything is
returns as a unicode string so checks higher up the call chain don't
barf.
Signed-off-by: Alex Bennée <address@hidden>
fixup! tests/docker: handle missing encoding keyword for subprocess.check_output
diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 1620293ac84..417b0cdce13 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -258,10 +258,16 @@ class Docker(object):
return self._do_kill_instances(True)
def _output(self, cmd, **kwargs):
- return subprocess.check_output(self._command + cmd,
- stderr=subprocess.STDOUT,
- encoding='utf-8',
- **kwargs)
+ if sys.version_info[1] >= 6:
+ return subprocess.check_output(self._command + cmd,
+ stderr=subprocess.STDOUT,
+ encoding='utf-8',
+ **kwargs)
+ else:
+ return subprocess.check_output(self._command + cmd,
+ stderr=subprocess.STDOUT,
+ **kwargs).decode('utf-8')
+
def inspect_tag(self, tag):
try:
--
2.20.1
- [Qemu-devel] [PULL 00/45] testing updates (fixes, upgrades, caching), Alex Bennée, 2019/09/10
- [Qemu-devel] [PULL 02/45] configure: clean-up container cross compile detect, Alex Bennée, 2019/09/10
- [Qemu-devel] [PULL 01/45] hw/misc: Mark most objects as "common" code to speed up compilation a litte bit, Alex Bennée, 2019/09/10
- [Qemu-devel] [PULL 05/45] tests/docker: handle missing encoding keyword for subprocess.check_output,
Alex Bennée <=
- [Qemu-devel] [PULL 06/45] tests/docker: fix final missing .encode when parsing solibs, Alex Bennée, 2019/09/10
- [Qemu-devel] [PULL 10/45] tests/tcg: add .gitignore for in source builds, Alex Bennée, 2019/09/10
- [Qemu-devel] [PULL 03/45] tests/docker: Use --userns=keep-id for podman, Alex Bennée, 2019/09/10
- [Qemu-devel] [PULL 04/45] tests/docker: fix "cc" command to work with podman, Alex Bennée, 2019/09/10
- [Qemu-devel] [PULL 16/45] tests/docker: move our Alpha cross compile to Buster, Alex Bennée, 2019/09/10
- [Qemu-devel] [PULL 07/45] tests/tcg: use EXTRA_CFLAGS everywhere, Alex Bennée, 2019/09/10
- [Qemu-devel] [PULL 13/45] tests/docker: add Buster to DOCKER_PARTIAL_IMAGES, Alex Bennée, 2019/09/10
- [Qemu-devel] [PULL 18/45] tests/docker: move our m68k cross compile to Buster, Alex Bennée, 2019/09/10
- [Qemu-devel] [PULL 08/45] tests/tcg: cleanup Makefile inclusions, Alex Bennée, 2019/09/10
- [Qemu-devel] [PULL 15/45] tests/docker: move our powerpc cross compile to Buster, Alex Bennée, 2019/09/10