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 1Ql4vM-0005s2-TV for garchives@archives.gentoo.org; Sun, 24 Jul 2011 20:05:17 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CC52721C05D; Sun, 24 Jul 2011 20:05:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9AFAA21C05D for ; Sun, 24 Jul 2011 20:05:08 +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 2C02B64ACA for ; Sun, 24 Jul 2011 20:05:08 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 4E0948003D for ; Sun, 24 Jul 2011 20:05:07 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <029ea8d67ed8ab476533338f53c934acf1406749.mgorny@gentoo> Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/basepm/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/basepm/pkg.py X-VCS-Directories: gentoopm/basepm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 029ea8d67ed8ab476533338f53c934acf1406749 Date: Sun, 24 Jul 2011 20:05:07 +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: 6dbbb76fbba31ea3709c2a5d28032a0a commit: 029ea8d67ed8ab476533338f53c934acf1406749 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Sun Jul 24 20:05:45 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Sun Jul 24 20:05:45 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoopm.git;= a=3Dcommit;h=3D029ea8d6 Py3: replace callable() with hasattr(..., '__call__'). --- gentoopm/basepm/pkg.py | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gentoopm/basepm/pkg.py b/gentoopm/basepm/pkg.py index 06b3fee..caa639e 100644 --- a/gentoopm/basepm/pkg.py +++ b/gentoopm/basepm/pkg.py @@ -92,12 +92,12 @@ class PMPackage(PMAtom, FillMissingComparisons): """ =20 for f in args: - if callable(f): # a matcher - if not f(self): - return False - elif isinstance(f, PMAtom): # an atom + if isinstance(f, PMAtom): # an atom if not self in f: return False + elif hasattr(f, '__call__'): + if not f(self): + return False else: raise ValueError('Incorrect positional argument: %s' % f) =20