qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v2 3/5] qapi: Use OrderedDict from standard library


From: Daniel P. Berrange
Subject: [Qemu-devel] [PATCH v2 3/5] qapi: Use OrderedDict from standard library if available
Date: Thu, 31 Aug 2017 15:24:28 +0100

The OrderedDict class appeared in the 'collections' module
from python 2.7 onwards, so use that in preference to our
local backport if available.

Signed-off-by: Daniel P. Berrange <address@hidden>
---
 scripts/qapi.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/qapi.py b/scripts/qapi.py
index d89af7d6c6..05cb1ee38c 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',
-- 
2.13.5




reply via email to

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