2018-02-22 23:01:24 +01:00
|
|
|
From a1cd35be6c021ebea74d43da4ebb3b92b7064b72 Mon Sep 17 00:00:00 2001
|
2018-01-26 00:50:30 +01:00
|
|
|
From: "Daniel P. Berrange" <berrange@redhat.com>
|
2018-02-08 20:55:31 +01:00
|
|
|
Date: Tue, 16 Jan 2018 13:42:06 +0000
|
2018-01-26 00:50:30 +01:00
|
|
|
Subject: [PATCH] qapi: Use OrderedDict from standard library if available
|
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
|
|
|
|
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é <f4bug@amsat.org>
|
|
|
|
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
2018-02-08 20:55:31 +01:00
|
|
|
Message-Id: <20180116134217.8725-4-berrange@redhat.com>
|
|
|
|
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
|
(cherry picked from commit 38710a8994911d98acbe183a39ec3a53638de510)
|
|
|
|
[BR: BSC#1077564]
|
|
|
|
Signed-off-by: Bruce Rogers <brogers@suse.com>
|
2018-01-26 00:50:30 +01:00
|
|
|
---
|
|
|
|
scripts/qapi.py | 5 ++++-
|
|
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/scripts/qapi.py b/scripts/qapi.py
|
|
|
|
index d5ac21ad35..dba6cd6779 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
|
|
|
|
|
|
|
|
builtin_types = {
|
|
|
|
'null': 'QTYPE_QNULL',
|