From 8249b91f811481a009e2f756e24bd21c5275af97 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 5 Aug 2024 18:23:17 +0200 Subject: [PATCH] Clarify the comment explaining an assertion Signed-off-by: Gilles Peskine --- scripts/search_outcomes_config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/search_outcomes_config.py b/scripts/search_outcomes_config.py index f702e8111..5ecc9a545 100755 --- a/scripts/search_outcomes_config.py +++ b/scripts/search_outcomes_config.py @@ -57,8 +57,11 @@ def extract_configuration_data(outcome_lines: List[str]) -> Dict[str, FrozenSet[ config_data = {} #type: Dict[str, Set[str]] for line in outcome_lines: m = OUTCOME_LINE_RE.match(line) - # make_regexp_for_settings() arranges to only return lines that - # should match here. + # Assuming a well-formed outcome file, make_regexp_for_settings() + # arranges to only return lines that should match OUTCOME_LINE_RE. + # So this assertion can't fail unless there is an unexpected + # divergence between OUTCOME_LINE_RE, make_regexp_for_settings() + # and the format of the given outcome file assert m is not None config_name, setting = m.groups() if config_name not in config_data: