From 9be364568835e467199ccd65bbcd786f9c8171dc Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Mon, 21 Apr 2025 10:58:10 -0600 Subject: gh-132777: Fix Error Message for Duplicates in generate_global_scripts.py (gh-132780) The fstring would actually raise a KeyError, which we fix. We also adjust the text to be correct. --- Tools/build/generate_global_objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/build/generate_global_objects.py b/Tools/build/generate_global_objects.py index 29bd995..94905b3 100644 --- a/Tools/build/generate_global_objects.py +++ b/Tools/build/generate_global_objects.py @@ -439,7 +439,7 @@ def get_identifiers_and_strings() -> 'tuple[set[str], dict[str, str]]': if string not in strings: strings[string] = name elif name != strings[string]: - raise ValueError(f'string mismatch for {name!r} ({string!r} != {strings[name]!r}') + raise ValueError(f'name mismatch for string {string!r} ({name!r} != {strings[string]!r}') overlap = identifiers & set(strings.keys()) if overlap: raise ValueError( -- cgit v0.12