diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-01-29 14:35:37 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-01-29 22:11:35 +0000 |
commit | 635130d0d1234c503aa8b7ea10473f63afd36ad5 (patch) | |
tree | 4170f81d63080fc88c9cec680dd9db3be33fa347 /bitbake | |
parent | 087424d925d1d9207b7ffa1483bf5f39ef035c5c (diff) | |
download | poky-635130d0d1234c503aa8b7ea10473f63afd36ad5.tar.gz |
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 7 |
1 files changed, 6 insertions, 1 deletions
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): | |||
296 | self.variables[var] = [] | 296 | self.variables[var] = [] |
297 | 297 | ||
298 | class DataSmart(MutableMapping): | 298 | class DataSmart(MutableMapping): |
299 | def __init__(self, special = COWDictBase.copy(), seen = COWDictBase.copy() ): | 299 | def __init__(self, special = None, seen = None ): |
300 | self.dict = {} | 300 | self.dict = {} |
301 | 301 | ||
302 | if special is None: | ||
303 | special = COWDictBase.copy() | ||
304 | if seen is None: | ||
305 | seen = COWDictBase.copy() | ||
306 | |||
302 | self.inchistory = IncludeHistory() | 307 | self.inchistory = IncludeHistory() |
303 | self.varhistory = VariableHistory(self) | 308 | self.varhistory = VariableHistory(self) |
304 | self._tracking = False | 309 | self._tracking = False |