diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-09-09 13:08:32 -0400 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-09-09 13:09:27 -0400 |
commit | 393ac353605bc6f8b13f3f6c3a7d8ef5b7e2db87 (patch) | |
tree | 6625dbbc6a1f76ea665af55e0c65067fef1a9bd4 /buildstream/_yaml.py | |
parent | 6b015df5e7a5754522278f8321e138439dc957c1 (diff) | |
download | buildstream-393ac353605bc6f8b13f3f6c3a7d8ef5b7e2db87.tar.gz |
_yaml.py: Removing unused CompositePolicy.STRICT
This composite policy is on the way out the door anyway, first
lets reduce some unused code though.
Diffstat (limited to 'buildstream/_yaml.py')
-rw-r--r-- | buildstream/_yaml.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/buildstream/_yaml.py b/buildstream/_yaml.py index 527f5371c..5ba540fc9 100644 --- a/buildstream/_yaml.py +++ b/buildstream/_yaml.py @@ -180,9 +180,6 @@ class CompositePolicy(Enum): # Arrays from the overriding dict are appended to arrays in the target dict ARRAY_APPEND = 2 - # Dictionary memebers may never replace existing members - STRICT = 3 - # Loads a dictionary from some YAML # @@ -519,17 +516,8 @@ def composite_dict(target, source, policy=CompositePolicy.OVERWRITE, typesafe=Fa target[key] = source_value target_provenance.members[key] = source_provenance.members[key].clone() - elif policy == CompositePolicy.STRICT: - - if target_value is None: - target[key] = source_value - target_provenance.members[key] = source_provenance.members[key] - else: - raise CompositeOverrideError(thispath) - - else: - # Explicitly unhandled: Indicates a clear programming error - raise Exception("Unhandled CompositePolicy in switch case") + else: # pragma: no cover + raise ValueError("Unhandled CompositePolicy in switch case") # Like composite_dict(), but raises an all purpose LoadError for convenience |