From: W. Trevor King Date: Mon, 12 Nov 2012 02:06:58 +0000 (-0500) Subject: helpers: convert get_cpvs output to a set before calculating len() X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=14bb81fb3801caf6b09e7c4cbe2dfdc36cb03525;p=gentoolkit.git helpers: convert get_cpvs output to a set before calculating len() This avoids "TypeError: object of type 'generator' has no len()". --- 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