From: Eric Snow Date: Mon, 21 Apr 2025 16:58:10 +0000 (-0600) Subject: gh-132777: Fix Error Message for Duplicates in generate_global_scripts.py (gh-132780) X-Git-Tag: v3.14.0b1~381 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9be364568835e467199ccd65bbcd786f9c8171dc;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Tools/build/generate_global_objects.py b/Tools/build/generate_global_objects.py index 29bd995655e0..94905b3756d0 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(