mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -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
|
@ -14,7 +14,6 @@
|
|||
# This work is licensed under the terms of the GNU GPL, version 2.
|
||||
# See the COPYING file in the top-level directory.
|
||||
|
||||
from collections import OrderedDict
|
||||
import os
|
||||
import re
|
||||
from typing import (
|
||||
|
@ -154,7 +153,7 @@ class QAPISchemaParser:
|
|||
"value of 'include' must be a string")
|
||||
incl_fname = os.path.join(os.path.dirname(self._fname),
|
||||
include)
|
||||
self._add_expr(OrderedDict({'include': incl_fname}), info)
|
||||
self._add_expr({'include': incl_fname}, info)
|
||||
exprs_include = self._include(include, info, incl_fname,
|
||||
self._included)
|
||||
if exprs_include:
|
||||
|
@ -355,7 +354,7 @@ class QAPISchemaParser:
|
|||
raise QAPIParseError(self, "stray '%s'" % match.group(0))
|
||||
|
||||
def get_members(self) -> Dict[str, object]:
|
||||
expr: Dict[str, object] = OrderedDict()
|
||||
expr: Dict[str, object] = {}
|
||||
if self.tok == '}':
|
||||
self.accept()
|
||||
return expr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue