From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzWP3-0005wB-Bi for qemu-devel@nongnu.org; Wed, 07 Apr 2010 10:38:49 -0400 Received: from [140.186.70.92] (port=37582 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzWP1-0005vx-Vk for qemu-devel@nongnu.org; Wed, 07 Apr 2010 10:38:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzWP0-0006l9-OF for qemu-devel@nongnu.org; Wed, 07 Apr 2010 10:38:47 -0400 Received: from fg-out-1718.google.com ([72.14.220.159]:42609) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzWP0-0006kz-IK for qemu-devel@nongnu.org; Wed, 07 Apr 2010 10:38:46 -0400 Received: by fg-out-1718.google.com with SMTP id l26so1299841fgb.10 for ; Wed, 07 Apr 2010 07:38:45 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4BBC8DE4.7020509@redhat.com> References: <20100407103610.4080b945@redhat.com> <4BBC8DE4.7020509@redhat.com> From: Costas Drogos Date: Wed, 7 Apr 2010 17:38:20 +0300 Message-ID: Subject: Re: [Qemu-devel] Re: [PATCH 1/1] QMP test code - qmp.py Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Avi Kivity , Luiz Capitulino On Wed, Apr 7, 2010 at 16:51, Avi Kivity wrote: >> =C2=A0This won't do what we want for 2.7 and newer, so a better if would= be: Thats why i said it is just an ugly hack :) Anyway, I've just cloned the qmp-unstable tree to run some tests and report back >> if sys.version_info< =C2=A0(2, 6): >> =C2=A0 =C2=A0 import simplejson as json >> else: >> =C2=A0 =C2=A0 import json >> >> > > try: > =C2=A0 =C2=A0import json > except: > =C2=A0 =C2=A0import simplejson as json I thought of that, but the thing is that, in Debian at least, there is python-json for python 2.5 which does not work, but can be imported, and also python-simplejson. On python2.6 json module is included and there is a package python2.6-simplejson also. Anyway, we can't check what every distribution does with modules, so I think Avi's solution works most of the times. In the end it is just a test script :) Thanks for the comments :) --=20 Costas Drogos