From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QUO4m-0006Uo-Rn for garchives@archives.gentoo.org; Wed, 08 Jun 2011 19:06:00 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6DA831C0E8; Wed, 8 Jun 2011 19:05:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3AEFE1C0E8 for ; Wed, 8 Jun 2011 19:05:51 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A1BA264ACA for ; Wed, 8 Jun 2011 19:05:50 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id F34DD8003C for ; Wed, 8 Jun 2011 19:05:49 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <0388944a560582abcbf5c7b0257d48918ac11455.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dep/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dep/__init__.py X-VCS-Directories: pym/portage/dep/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 0388944a560582abcbf5c7b0257d48918ac11455 Date: Wed, 8 Jun 2011 19:05:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: da081d1c75f9f7c42558402f64d710f8 commit: 0388944a560582abcbf5c7b0257d48918ac11455 Author: Zac Medico gentoo org> AuthorDate: Wed Jun 8 19:03:25 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Jun 8 19:03:25 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D0388944a Atom: avoid TypeError with PyPy Our test cases pass in raw bytes here, which causes _atom_base.__init__ to raise TypeError with PyPy. --- pym/portage/dep/__init__.py | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index 8332a05..8621543 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -30,7 +30,7 @@ __all__ =3D [ import re, sys import warnings from itertools import chain -import portage.exception +from portage import _unicode_decode from portage.eapi import eapi_has_slot_deps, eapi_has_src_uri_arrows, \ eapi_has_use_deps, eapi_has_strong_blocks, eapi_has_use_dep_defaults from portage.exception import InvalidAtom, InvalidData, InvalidDependStr= ing @@ -1057,6 +1057,10 @@ class Atom(_atom_base): raise TypeError(_("Expected %s, got %s") % \ (_atom_base, type(s))) =20 + if not isinstance(s, _atom_base): + # Avoid TypeError with from _atom_base.__init__ with PyPy. + s =3D _unicode_decode(s) + _atom_base.__init__(s) =20 if "!" =3D=3D s[:1]: