From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaVVt-0003ju-9c for qemu-devel@nongnu.org; Tue, 24 Mar 2015 16:33:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaVVq-0000fD-58 for qemu-devel@nongnu.org; Tue, 24 Mar 2015 16:33:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaVVq-0000f8-0S for qemu-devel@nongnu.org; Tue, 24 Mar 2015 16:33:22 -0400 Message-ID: <5511CA0F.9070408@redhat.com> Date: Tue, 24 Mar 2015 14:33:19 -0600 From: Eric Blake MIME-Version: 1.0 References: <1427227433-5030-1-git-send-email-eblake@redhat.com> <1427227433-5030-4-git-send-email-eblake@redhat.com> In-Reply-To: <1427227433-5030-4-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tNrWUVTHRxTPBhcadLBKKTArQFOWGJMHF" Subject: Re: [Qemu-devel] [PATCH v5 03/28] qapi: Require ASCII in schema List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, lcapitulino@redhat.com, famz@redhat.com, armbru@redhat.com, wenchaoqemu@gmail.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tNrWUVTHRxTPBhcadLBKKTArQFOWGJMHF Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/24/2015 02:03 PM, Eric Blake wrote: > Python 2 and Python 3 have a wild history of whether strings > default to ascii or unicode, where Python 3 requires checking > instanceof(foo, basestr) to cover all strings, but where that > code is not portable to Python 2. It's simpler to just state > that we don't care about Unicode strings, and to just always > use the simpler instanceof(foo, str) everywhere. And for all my proof-reading, I already have a commit message change: s/instanceof/isinstance/ (you can tell I'm not that proficient in python...) >=20 > I'm no python expert, so I'm basing it on this conversation: > https://lists.gnu.org/archive/html/qemu-devel/2014-09/msg05278.html >=20 > Signed-off-by: Eric Blake > --- > scripts/qapi.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > @@ -354,7 +354,7 @@ def parse_schema(input_file): > return exprs >=20 > def parse_args(typeinfo): > - if isinstance(typeinfo, basestring): > + if isinstance(typeinfo, str): at least the code is right. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --tNrWUVTHRxTPBhcadLBKKTArQFOWGJMHF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVEcoPAAoJEKeha0olJ0NqTocIAJ7h/5evDJpmzpDE0sIWvByl n4bjMXQAB5xjzcWDX74e4jJ7iHSny2qEIoAimzc59zOAbPdsntFQLyZYA6U3UDGx qIAwBoAuZETY4vTbrkIorsvCHvSzI1Y/u0bST7dNPoLFiz6/u0b5uuwlq2qFc6sC DJhPaHFw3PkUdTxgQXhwPume1SU66Y7Tuq5xMdQezaT1hDVmcmCtujHiUFNZoOx/ 8JrCqYkB/Ji6z8MG6d9UflQDlgDi28qKnQx4duAMZtQhUUDC4EY7vEOEJiXp2OsA LNAyVlqHYpDzk6c3IqQJSdb+maKa81iuMe1InR3Jd8k/myKgDzt4bJhS9SR/gSM= =NhpM -----END PGP SIGNATURE----- --tNrWUVTHRxTPBhcadLBKKTArQFOWGJMHF--