diff options
| author | Markus Armbruster <armbru@redhat.com> | 2025-02-27 09:07:56 +0100 |
|---|---|---|
| committer | Markus Armbruster <armbru@redhat.com> | 2025-03-06 10:09:22 +0100 |
| commit | 5fbc8126acaf07a0294f8f94f4c244c3c5b62d5d (patch) | |
| tree | a33f353c8ae25871313e39ab670cc9693b61e4b9 /tests/qapi-schema/test-qapi.py | |
| parent | 87c8b4fc3c1c89ec52540bfb74f9b0518f247323 (diff) | |
| download | focaccia-qemu-5fbc8126acaf07a0294f8f94f4c244c3c5b62d5d.tar.gz focaccia-qemu-5fbc8126acaf07a0294f8f94f4c244c3c5b62d5d.zip | |
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-x | tests/qapi-schema/test-qapi.py | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index 7e3f9f4aa1..8fe951c880 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): |