From 14bb81fb3801caf6b09e7c4cbe2dfdc36cb03525 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 11 Nov 2012 21:06:58 -0500 Subject: [PATCH] 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 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.26.2