[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/5] qapi: Use OrderedDict from standard libr
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 3/5] qapi: Use OrderedDict from standard library if available |
Date: |
Thu, 31 Aug 2017 11:02:53 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 08/31/2017 09:24 AM, Daniel P. Berrange wrote:
> The OrderedDict class appeared in the 'collections' module
> from python 2.7 onwards, so use that in preference to our
> local backport if available.
Since we're now using argparse.py as a third-party import (commit
47e1cb1f) also for the sake of 2.6, can we treat ordereddict.py as the
same sort of third-party import?
>
> 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',
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v2 0/5] qapi: support py2 & py3 in parallel, Daniel P. Berrange, 2017/08/31
- [Qemu-devel] [PATCH v2 1/5] qapi: convert to use python print function instead of statement, Daniel P. Berrange, 2017/08/31
- [Qemu-devel] [PATCH v2 2/5] qapi: use items()/values() intead of iteritems()/itervalues(), Daniel P. Berrange, 2017/08/31
- [Qemu-devel] [PATCH v2 3/5] qapi: Use OrderedDict from standard library if available, Daniel P. Berrange, 2017/08/31
- Re: [Qemu-devel] [PATCH v2 3/5] qapi: Use OrderedDict from standard library if available,
Eric Blake <=
- [Qemu-devel] [PATCH v2 4/5] qapi: adapt to moved location of StringIO module in py3, Daniel P. Berrange, 2017/08/31
- [Qemu-devel] [PATCH v2 5/5] qapi: Adapt to moved location of 'maketrans' function in py3, Daniel P. Berrange, 2017/08/31