Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mbed OS 5.15: Warn on unrecognised error #13031

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tools/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might consider adding a comment why this needs to be a list (because we are modifying the features list and need to iterate on a copy).

if feature not in ALLOWED_FEATURES:
raise ConfigException(
"Feature '%s' is not a supported features" % feature)
print("[WARNING] Feature '%s' is not a supported feature" % feature)
self.target.features.remove(feature)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this feature will prevent that feature from being defined or having any effect, which is a nice guarantee.


return self.target.features

Expand Down