From 90b9736164ff649538178e5fda85091b66aa0eea Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Wed, 27 May 2020 16:17:10 +0100 Subject: [PATCH 1/2] tools: Fix grammar in feature error message Use "not a supported feature" instead of "not a supported features". --- tools/config/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/config/__init__.py b/tools/config/__init__.py index 771ea071429..19858e5e4da 100755 --- a/tools/config/__init__.py +++ b/tools/config/__init__.py @@ -1357,7 +1357,7 @@ def get_features(self): for feature in self.target.features: if feature not in ALLOWED_FEATURES: raise ConfigException( - "Feature '%s' is not a supported features" % feature) + "Feature '%s' is not a supported feature" % feature) return self.target.features From cd1b59b511754c9da8623d2cecc9d0043cffe6b2 Mon Sep 17 00:00:00 2001 From: Darryl Green Date: Fri, 29 May 2020 12:51:58 +0100 Subject: [PATCH 2/2] 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 --- tools/config/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/config/__init__.py b/tools/config/__init__.py index 19858e5e4da..14181ead0d1 100755 --- a/tools/config/__init__.py +++ b/tools/config/__init__.py @@ -1354,10 +1354,13 @@ def get_features(self): self.cumulative_overrides['features']\ .update_target(self.target) - for feature in self.target.features: + # Features that don't appear in ALLOWED_FEATURES should be removed + # with a warning so that they don't do anything unexpected. + # Iterate over a copy of the set to remove them safely. + for feature in list(self.target.features): if feature not in ALLOWED_FEATURES: - raise ConfigException( - "Feature '%s' is not a supported feature" % feature) + print("[WARNING] Feature '%s' is not a supported feature" % feature) + self.target.features.remove(feature) return self.target.features