mirror of https://gitee.com/openkylin/qemu.git
tests/docker: handle missing encoding keyword for subprocess.check_output
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 <alex.bennee@linaro.org> fixup! tests/docker: handle missing encoding keyword for subprocess.check_output
This commit is contained in:
parent
71ebbe09e9
commit
884fcafc9c
|
@ -258,10 +258,16 @@ def _kill_instances(self, *args, **kwargs):
|
||||||
return self._do_kill_instances(True)
|
return self._do_kill_instances(True)
|
||||||
|
|
||||||
def _output(self, cmd, **kwargs):
|
def _output(self, cmd, **kwargs):
|
||||||
return subprocess.check_output(self._command + cmd,
|
if sys.version_info[1] >= 6:
|
||||||
stderr=subprocess.STDOUT,
|
return subprocess.check_output(self._command + cmd,
|
||||||
encoding='utf-8',
|
stderr=subprocess.STDOUT,
|
||||||
**kwargs)
|
encoding='utf-8',
|
||||||
|
**kwargs)
|
||||||
|
else:
|
||||||
|
return subprocess.check_output(self._command + cmd,
|
||||||
|
stderr=subprocess.STDOUT,
|
||||||
|
**kwargs).decode('utf-8')
|
||||||
|
|
||||||
|
|
||||||
def inspect_tag(self, tag):
|
def inspect_tag(self, tag):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue