projects
/
gentoolkit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cfe0127
)
helpers: convert get_cpvs output to a set before calculating len()
author
W. Trevor King
<wking@tremily.us>
Mon, 12 Nov 2012 02:06:58 +0000
(21:06 -0500)
committer
W. Trevor King
<wking@tremily.us>
Mon, 12 Nov 2012 02:06:58 +0000
(21:06 -0500)
This avoids "TypeError: object of type 'generator' has no len()".
pym/gentoolkit/helpers.py
patch
|
blob
|
history
diff --git
a/pym/gentoolkit/helpers.py
b/pym/gentoolkit/helpers.py
index 706b5261318bbb38a6db00cd94648fcdeb44533b..cc3bf3500a1f6c2265c69ebe3f0461d9c11edb57 100644
(file)
--- 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