summaryrefslogtreecommitdiff
path: root/buildstream/_yaml.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-02-26 21:14:22 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-02-26 21:14:22 +0900
commit0ce019476810bebf7c056b869b91a7db35f98035 (patch)
treea7d258a503be4985c9083bb6b951b90e7c85ab18 /buildstream/_yaml.py
parent794d65c05c77184a98c9d155ec1dfff133969735 (diff)
downloadbuildstream-0ce019476810bebf7c056b869b91a7db35f98035.tar.gz
_yaml.py: Use _list_chain_copy() in place of deepcopy()
When copying over lists while compositing dicts.
Diffstat (limited to 'buildstream/_yaml.py')
-rw-r--r--buildstream/_yaml.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/buildstream/_yaml.py b/buildstream/_yaml.py
index 35bcd4877..ae9ff2212 100644
--- a/buildstream/_yaml.py
+++ b/buildstream/_yaml.py
@@ -24,6 +24,7 @@ from enum import Enum
from ruamel import yaml
from . import LoadError, LoadErrorReason
+from . import utils
# We store information in the loaded yaml on a DictProvenance
# stored in all dictionaries under this key
@@ -458,7 +459,7 @@ def composite_dict(target, source, policy=CompositePolicy.OVERWRITE, typesafe=Fa
# Ensure target has only copies of mutable source values
if (isinstance(target_value, list) and
isinstance(source_value, list)):
- target[key] = copy.deepcopy(source_value)
+ target[key] = utils._list_chain_copy(source_value)
else:
target[key] = source_value
@@ -468,7 +469,7 @@ def composite_dict(target, source, policy=CompositePolicy.OVERWRITE, typesafe=Fa
isinstance(source_value, list)):
# Ensure target has only copies of mutable source values
- target[key] += copy.deepcopy(source_value)
+ target[key] += utils._list_chain_copy(source_value)
# Append element provenances from source list to target
target_list_provenance = target_provenance.members[key]