diff options
author | W. Trevor King <wking@tremily.us> | 2012-11-11 21:06:58 -0500 |
---|---|---|
committer | W. Trevor King <wking@tremily.us> | 2012-11-11 21:06:58 -0500 |
commit | 14bb81fb3801caf6b09e7c4cbe2dfdc36cb03525 (patch) | |
tree | d0f5f72abe0a8e97653bf49410bca2e9a3041202 /pym/gentoolkit/helpers.py | |
parent | helpers: use print() in ChangeLog doctest for Python 3 compatibility (diff) | |
download | gentoolkit-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.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 |