rules: fix bug validating rules

This commit is contained in:
William Ballenthin
2021-06-14 10:35:57 -06:00
parent 152060a28a
commit 6411732bea

View File

@@ -155,6 +155,7 @@ def ensure_feature_valid_for_scope(scope: str, feature: Feature):
):
raise InvalidRule("feature %s not support for scope %s" % (feature, scope))
if not isinstance(feature, capa.features.common.Characteristic):
# features of this scope that are not Characteristics will be Type instances.
# check that the given feature is one of these types.
types_for_scope = filter(lambda t: isinstance(t, type), SUPPORTED_FEATURES[scope])