Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH] data_smart: Ensure d.keys() doesn't list deleted variables
@ 2014-12-23 12:32 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2014-12-23 12:32 UTC (permalink / raw)
  To: bitbake-devel

If you copy the datastore, then delete a variable, it still shows up
in d.keys() when it should not. This patch addresses the issue.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 31ce9a5..68d273b 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -740,12 +740,16 @@ class DataSmart(MutableMapping):
                 yield key
 
     def __iter__(self):
+        deleted = set()
         def keylist(d):        
             klist = set()
             for key in d:
                 if key == "_data":
                     continue
+                if key in deleted:
+                    continue
                 if not d[key]:
+                    deleted.add(key)
                     continue
                 klist.add(key)
 




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-12-23 12:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-23 12:32 [PATCH] data_smart: Ensure d.keys() doesn't list deleted variables Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox