mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
python: remove more instances of sys.version_info
We guarantee 3.5+ everywhere; remove more dead checks. In general, try to avoid using version checks and instead prefer to attempt behavior when possible. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200514035230.25756-1-jsnow@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
parent
c7b942d7f8
commit
2d110c1149
5 changed files with 13 additions and 30 deletions
|
@ -258,12 +258,13 @@ class Docker(object):
|
|||
return self._do_kill_instances(True)
|
||||
|
||||
def _output(self, cmd, **kwargs):
|
||||
if sys.version_info[1] >= 6:
|
||||
try:
|
||||
return subprocess.check_output(self._command + cmd,
|
||||
stderr=subprocess.STDOUT,
|
||||
encoding='utf-8',
|
||||
**kwargs)
|
||||
else:
|
||||
except TypeError:
|
||||
# 'encoding' argument was added in 3.6+
|
||||
return subprocess.check_output(self._command + cmd,
|
||||
stderr=subprocess.STDOUT,
|
||||
**kwargs).decode('utf-8')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue