Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qapi: Fix code generation with Python 3.5
Recent commit 3e7fb58 "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: 3e7fb58 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: [email protected] Signed-off-by: Peter Maydell <[email protected]>
- Loading branch information