[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 43d145: qapi: Fix code generation with Python

From: Machine user for deployment to qemu organization
Subject: [Qemu-commits] [qemu/qemu] 43d145: qapi: Fix code generation with Python 3.5
Date: Mon, 20 Jan 2020 05:00:17 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 43d1455cf84283466e5c22a217db5ef4b8197b14
  Author: Markus Armbruster <address@hidden>
  Date:   2020-01-20 (Mon, 20 Jan 2020)

  Changed paths:
    M scripts/qapi/schema.py

  Log Message:
  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 <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Tested-by: Thomas Huth <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: BALATON Zoltan <address@hidden>
Tested-by: Alex Bennée <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]