From b492836e08745e04bd9ba2fb0b56a680a5fdce79 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Sat, 30 Apr 2016 12:43:54 -0700 Subject: 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 Signed-off-by: Richard Purdie --- lib/bb/data_smart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit 1.2.3-korg