aboutsummaryrefslogtreecommitdiff
path: root/tests/qapi-schema/test-qapi.py
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2025-02-27 09:07:56 +0100
committerMarkus Armbruster <armbru@redhat.com>2025-03-06 10:09:22 +0100
commit5fbc8126acaf07a0294f8f94f4c244c3c5b62d5d (patch)
treea33f353c8ae25871313e39ab670cc9693b61e4b9 /tests/qapi-schema/test-qapi.py
parent87c8b4fc3c1c89ec52540bfb74f9b0518f247323 (diff)
downloadqemu-5fbc8126acaf07a0294f8f94f4c244c3c5b62d5d.zip
qemu-5fbc8126acaf07a0294f8f94f4c244c3c5b62d5d.tar.gz
qemu-5fbc8126acaf07a0294f8f94f4c244c3c5b62d5d.tar.bz2
qapi: Eliminate OrderedDict
We use OrderedDict to ensure dictionary order is insertion order. Plain dict does that since Python 3.6, but it wasn't guaranteed until 3.7. Since we have 3.7 now, replace OrderedDict by dict. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20250227080757.3978333-3-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'tests/qapi-schema/test-qapi.py')
-rwxr-xr-xtests/qapi-schema/test-qapi.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
index 7e3f9f4..8fe951c 100755
--- a/tests/qapi-schema/test-qapi.py
+++ b/tests/qapi-schema/test-qapi.py
@@ -96,17 +96,8 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
@staticmethod
def _print_if(ifcond, indent=4):
- # TODO Drop this hack after replacing OrderedDict by plain
- # dict (requires Python 3.7)
- def _massage(subcond):
- if isinstance(subcond, str):
- return subcond
- if isinstance(subcond, list):
- return [_massage(val) for val in subcond]
- return {key: _massage(val) for key, val in subcond.items()}
-
if ifcond.is_present():
- print('%sif %s' % (' ' * indent, _massage(ifcond.ifcond)))
+ print('%sif %s' % (' ' * indent, ifcond.ifcond))
@classmethod
def _print_features(cls, features, indent=4):