From: Avi Kivity <avi@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Costas Drogos <costas.drogos@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [PATCH 1/1] QMP test code - qmp.py
Date: Wed, 07 Apr 2010 16:51:32 +0300 [thread overview]
Message-ID: <4BBC8DE4.7020509@redhat.com> (raw)
In-Reply-To: <20100407103610.4080b945@redhat.com>
On 04/07/2010 04:36 PM, Luiz Capitulino wrote:
>
>
>> diff --git a/QMP/qmp.py b/QMP/qmp.py
>> index d9da603..f8581c4 100644
>> --- a/QMP/qmp.py
>> +++ b/QMP/qmp.py
>> @@ -8,7 +8,15 @@
>> # This work is licensed under the terms of the GNU GPL, version 2. See
>> # the COPYING file in the top-level directory.
>>
>> -import socket, json
>> +import socket
>> +
>> +from sys import version
>> +ver = version[:3]
>> +
>> +if ver == '2.6':
>> + import json
>> +else:
>> + import simplejson as json
>>
> This won't do what we want for 2.7 and newer, so a better if would be:
>
> if sys.version_info< (2, 6):
> import simplejson as json
> else:
> import json
>
>
try:
import json
except:
import simplejson as json
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
next prev parent reply other threads:[~2010-04-07 13:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-07 0:40 [Qemu-devel] [PATCH 1/1] QMP test code - qmp.py Costas Drogos
2010-04-07 13:36 ` [Qemu-devel] " Luiz Capitulino
2010-04-07 13:51 ` Avi Kivity [this message]
2010-04-07 14:38 ` Costas Drogos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BBC8DE4.7020509@redhat.com \
--to=avi@redhat.com \
--cc=costas.drogos@gmail.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.