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.
This commit is contained in:
Eric Snow 2025-04-21 10:58:10 -06:00 committed by GitHub
parent 09b624b80f
commit 9be3645688
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(