Skip to content

Commit cf17d7a

Browse files
committed
Change unrecognised features to a warning, rather than error
Give a warning rather than error if an unrecognised feature is used. This will help compatibility when new features are added. Signed-off-by: Darryl Green <[email protected]>
1 parent 4e47c38 commit cf17d7a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/config/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,10 +1345,13 @@ def get_features(self):
13451345
self.cumulative_overrides['features']\
13461346
.update_target(self.target)
13471347

1348-
for feature in self.target.features:
1348+
# Features that don't appear in ALLOWED_FEATURES should be removed
1349+
# with a warning so that they don't do anything unexpected.
1350+
# Iterate over a copy of the set to remove them safely.
1351+
for feature in list(self.target.features):
13491352
if feature not in ALLOWED_FEATURES:
1350-
raise ConfigException(
1351-
"Feature '%s' is not a supported feature" % feature)
1353+
print("[WARNING] Feature '%s' is not a supported feature" % feature)
1354+
self.target.features.remove(feature)
13521355

13531356
return self.target.features
13541357

0 commit comments

Comments
 (0)