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 62AD01381F3 for ; Tue, 13 Nov 2012 20:43:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 65B7421C05F; Tue, 13 Nov 2012 20:41:09 +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 A9B2521C058 for ; Tue, 13 Nov 2012 20:41:03 +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 A1B2633DA6F for ; Tue, 13 Nov 2012 20:41:02 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 102B6E5450 for ; Tue, 13 Nov 2012 20:40:59 +0000 (UTC) From: "Paul Varner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Paul Varner" Message-ID: <1352686018.14bb81fb3801caf6b09e7c4cbe2dfdc36cb03525.fuzzyray@gentoo> Subject: [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/helpers.py X-VCS-Directories: pym/gentoolkit/ X-VCS-Committer: fuzzyray X-VCS-Committer-Name: Paul Varner X-VCS-Revision: 14bb81fb3801caf6b09e7c4cbe2dfdc36cb03525 X-VCS-Branch: gentoolkit Date: Tue, 13 Nov 2012 20:40:59 +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: 76a538a9-34b5-475a-aaef-edccc7ecb41d X-Archives-Hash: 0e23baf66db8dbb6c956988332eb61b4 commit: 14bb81fb3801caf6b09e7c4cbe2dfdc36cb03525 Author: W. Trevor King tremily us> AuthorDate: Mon Nov 12 02:06:58 2012 +0000 Commit: Paul Varner gentoo org> CommitDate: Mon Nov 12 02:06:58 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=14bb81fb helpers: convert get_cpvs output to a set before calculating len() This avoids "TypeError: object of type 'generator' has no len()". --- pym/gentoolkit/helpers.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py index 706b526..cc3bf35 100644 --- a/pym/gentoolkit/helpers.py +++ b/pym/gentoolkit/helpers.py @@ -373,7 +373,7 @@ def get_cpvs(predicate=None, include_installed=True): >>> len(set(get_cpvs())) 26065 >>> fn = lambda x: x.startswith('app-portage') - >>> len(get_cpvs(fn, include_installed=False)) + >>> len(set(get_cpvs(fn, include_installed=False))) 112 @type predicate: function