summaryrefslogtreecommitdiffstats
path: root/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-29 14:35:37 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-29 22:10:53 +0000
commit9facf3604759b00e8fe99f929353d46f8b8ba5cb (patch)
tree1f5cc5f9fb50a4b06f168e0a6e4868243756b4dc /lib/bb/data_smart.py
parent4fea138f7cef53626a40decb96207dbaf9284020 (diff)
downloadopenembedded-core-contrib-9facf3604759b00e8fe99f929353d46f8b8ba5cb.tar.gz
data_smart: Don't use mutable objects as default args
These only have one instance created which means your subsequent datastores can contain echos of previous ones. Obviously this is not the behaviour we want/expect. It doesn't affect bitbake too badly as we only have one datastore, it does massively potentially break our selftests though. Thanks to Tim Amsell for pointing out the now obvious problem! Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/data_smart.py')
-rw-r--r--lib/bb/data_smart.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 68d273b3a6..b1ea33fc30 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -296,9 +296,14 @@ class VariableHistory(object):
self.variables[var] = []
class DataSmart(MutableMapping):
- def __init__(self, special = COWDictBase.copy(), seen = COWDictBase.copy() ):
+ def __init__(self, special = None, seen = None ):
self.dict = {}
+ if special is None:
+ special = COWDictBase.copy()
+ if seen is None:
+ seen = COWDictBase.copy()
+
self.inchistory = IncludeHistory()
self.varhistory = VariableHistory(self)
self._tracking = False