From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id D150F1381F4 for ; Mon, 10 Dec 2012 17:53:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 864BB21C018; Mon, 10 Dec 2012 17:52:56 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 13DBD21C018 for ; Mon, 10 Dec 2012 17:52:56 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2C98C33DA4D for ; Mon, 10 Dec 2012 17:52:55 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id C29A5E543C for ; Mon, 10 Dec 2012 17:52:53 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1355161953.3b865a366bb1e2f22c7dc31ae181e3d0cf8a7c76.mgorny@gentoo> Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/portagepm/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/portagepm/repo.py X-VCS-Directories: gentoopm/portagepm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 3b865a366bb1e2f22c7dc31ae181e3d0cf8a7c76 X-VCS-Branch: master Date: Mon, 10 Dec 2012 17:52:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: d325e4f1-760d-4fa9-a3d2-285b7787831e X-Archives-Hash: 5440213001c2ac6a1e4ad5d9dc6566ff commit: 3b865a366bb1e2f22c7dc31ae181e3d0cf8a7c76 Author: Michał Górny gentoo org> AuthorDate: Mon Dec 10 17:52:33 2012 +0000 Commit: Michał Górny gentoo org> CommitDate: Mon Dec 10 17:52:33 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=3b865a36 Fix compatibility with PyPy. It seems that exception arguments are held differently for some reason. --- gentoopm/portagepm/repo.py | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/gentoopm/portagepm/repo.py b/gentoopm/portagepm/repo.py index 5d68120..6874757 100644 --- a/gentoopm/portagepm/repo.py +++ b/gentoopm/portagepm/repo.py @@ -126,7 +126,12 @@ class PortageFilteredRepo(PortageFilteredDBRepo): try: it = self._dbapi.xmatch("match-all", a) except pe.AmbiguousPackageName as e: - for pkgcand in e.args[0]: + try: + candidates = e.args[0] + except IndexError: # pypy? + candidates = e.value + + for pkgcand in candidates: for p in PortageHackedFilteredRepo(self, pkgcand): yield p else: