Skip to content

Commit cd1b59b

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 90b9736 commit cd1b59b

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
@@ -1354,10 +1354,13 @@ def get_features(self):
13541354
self.cumulative_overrides['features']\
13551355
.update_target(self.target)
13561356

1357-
for feature in self.target.features:
1357+
# Features that don't appear in ALLOWED_FEATURES should be removed
1358+
# with a warning so that they don't do anything unexpected.
1359+
# Iterate over a copy of the set to remove them safely.
1360+
for feature in list(self.target.features):
13581361
if feature not in ALLOWED_FEATURES:
1359-
raise ConfigException(
1360-
"Feature '%s' is not a supported feature" % feature)
1362+
print("[WARNING] Feature '%s' is not a supported feature" % feature)
1363+
self.target.features.remove(feature)
13611364

13621365
return self.target.features
13631366

0 commit comments

Comments
 (0)