]> Git Repo - qemu.git/commit
qapi: Fix code generation with Python 3.5
authorMarkus Armbruster <[email protected]>
Thu, 16 Jan 2020 20:25:58 +0000 (21:25 +0100)
committerPeter Maydell <[email protected]>
Mon, 20 Jan 2020 12:17:38 +0000 (12:17 +0000)
commit43d1455cf84283466e5c22a217db5ef4b8197b14
tree606e94940f599b47b200920c5c59b291f23a3ef6
parent26deea00260139fc5f323c3bf9db82a5d470538a
qapi: Fix code generation with Python 3.5

Recent commit 3e7fb5811b "qapi: Fix code generation for empty modules"
modules" switched QAPISchema.visit() from

    for entity in self._entity_list:

effectively to

    for mod in self._module_dict.values():
        for entity in mod._entity_list:

Visits in the same order as long as .values() is in insertion order.
That's the case only for Python 3.6 and later.  Before, it's in some
arbitrary order, which results in broken generated code.

Fix by making self._module_dict an OrderedDict rather than a dict.

Fixes: 3e7fb5811baab213dcc7149c3aa69442d683c26c
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Tested-by: Thomas Huth <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
Tested-by: BALATON Zoltan <[email protected]>
Tested-by: Alex Bennée <[email protected]>
Message-id: 20200116202558[email protected]
Signed-off-by: Peter Maydell <[email protected]>
scripts/qapi/schema.py
This page took 0.023981 seconds and 4 git commands to generate.