From 635130d0d1234c503aa8b7ea10473f63afd36ad5 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 29 Jan 2015 14:35:37 +0000 Subject: bitbake: 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! (Bitbake rev: 9facf3604759b00e8fe99f929353d46f8b8ba5cb) Signed-off-by: Richard Purdie --- bitbake/lib/bb/data_smart.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 68d273b3a6..b1ea33fc30 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/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 -- cgit v1.2.3-54-g00ecf