mirror of
https://github.com/qemu/qemu.git
synced 2024-12-05 01:33:41 +08:00
iotests: drop pre-Python 3.4 compatibility code
We no longer need to accommodate <3.4, drop this code. (The lines were > 79 chars and it stood out.) Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <20200331000014.11581-8-jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
b404b13bd5
commit
229fc0742a
@ -360,12 +360,9 @@ def log(msg, filters=(), indent=None):
|
|||||||
for flt in filters:
|
for flt in filters:
|
||||||
msg = flt(msg)
|
msg = flt(msg)
|
||||||
if isinstance(msg, (dict, list)):
|
if isinstance(msg, (dict, list)):
|
||||||
# Python < 3.4 needs to know not to add whitespace when pretty-printing:
|
|
||||||
separators = (', ', ': ') if indent is None else (',', ': ')
|
|
||||||
# Don't sort if it's already sorted
|
# Don't sort if it's already sorted
|
||||||
do_sort = not isinstance(msg, OrderedDict)
|
do_sort = not isinstance(msg, OrderedDict)
|
||||||
print(json.dumps(msg, sort_keys=do_sort,
|
print(json.dumps(msg, sort_keys=do_sort, indent=indent))
|
||||||
indent=indent, separators=separators))
|
|
||||||
else:
|
else:
|
||||||
print(msg)
|
print(msg)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user