bitbake: bb.data_smart: use iter() for __len__

It seems the frozenset constructor in pypy runs len(), so we can't pass the
DataSmart instance directly to it, instead pass the iterator. Fixes pypy
support.

(Bitbake rev: b492836e08745e04bd9ba2fb0b56a680a5fdce79)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Christopher Larson 2016-04-30 12:43:54 -07:00 committed by Richard Purdie
parent cd20dd057b
commit 39b79efc7e
1 changed files with 1 additions and 1 deletions

View File

@ -917,7 +917,7 @@ class DataSmart(MutableMapping):
yield k
def __len__(self):
return len(frozenset(self))
return len(frozenset(iter(self)))
def __getitem__(self, item):
value = self.getVar(item, False)