From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb8A7-0000GC-95 for qemu-devel@nongnu.org; Mon, 15 Jan 2018 12:03:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eb8A3-0006Qq-Ix for qemu-devel@nongnu.org; Mon, 15 Jan 2018 12:03:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50322) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eb8A3-0006QN-CT for qemu-devel@nongnu.org; Mon, 15 Jan 2018 12:03:03 -0500 From: "Daniel P. Berrange" Date: Mon, 15 Jan 2018 17:02:32 +0000 Message-Id: <20180115170243.24578-3-berrange@redhat.com> In-Reply-To: <20180115170243.24578-1-berrange@redhat.com> References: <20180115170243.24578-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v4 02/13] qapi: Use OrderedDict from standard library if available List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Markus Armbruster , Eduardo Habkost , Paolo Bonzini , "Daniel P. Berrange" The OrderedDict class appeared in the 'collections' module from python 2.7 onwards, so use that in preference to our local backport if available. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Daniel P. Berrange --- scripts/qapi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 98d7123d27..514b7bb5a4 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -18,7 +18,10 @@ import os import re import string import sys -from ordereddict import OrderedDict +try: + from collections import OrderedDict +except: + from ordereddict import OrderedDict =20 builtin_types =3D { 'null': 'QTYPE_QNULL', --=20 2.14.3