mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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>
This commit is contained in:
parent
87c8b4fc3c
commit
5fbc8126ac
3 changed files with 8 additions and 19 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue