aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2012-11-11 21:06:58 -0500
committerW. Trevor King <wking@tremily.us>2012-11-11 21:06:58 -0500
commit14bb81fb3801caf6b09e7c4cbe2dfdc36cb03525 (patch)
treed0f5f72abe0a8e97653bf49410bca2e9a3041202 /pym/gentoolkit/helpers.py
parenthelpers: use print() in ChangeLog doctest for Python 3 compatibility (diff)
downloadgentoolkit-14bb81fb3801caf6b09e7c4cbe2dfdc36cb03525.tar.gz
gentoolkit-14bb81fb3801caf6b09e7c4cbe2dfdc36cb03525.tar.bz2
gentoolkit-14bb81fb3801caf6b09e7c4cbe2dfdc36cb03525.zip
helpers: convert get_cpvs output to a set before calculating len()
This avoids "TypeError: object of type 'generator' has no len()".
Diffstat (limited to 'pym/gentoolkit/helpers.py')
-rw-r--r--pym/gentoolkit/helpers.py2
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