summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2016-04-30 12:43:54 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-06 10:18:06 +0100
commitb492836e08745e04bd9ba2fb0b56a680a5fdce79 (patch)
treed02907836fe074eb6fbbc41ef23b2b937c70d52d
parenta3e5d9337f5400aab13df63f261e750178f8a661 (diff)
downloadopenembedded-core-contrib-b492836e08745e04bd9ba2fb0b56a680a5fdce79.tar.gz
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. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/data_smart.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index fa1e794279..2ab884bb39 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -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)