]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-132777: Fix Error Message for Duplicates in generate_global_scripts.py (gh-132780)
authorEric Snow <ericsnowcurrently@gmail.com>
Mon, 21 Apr 2025 16:58:10 +0000 (10:58 -0600)
committerGitHub <noreply@github.com>
Mon, 21 Apr 2025 16:58:10 +0000 (16:58 +0000)
The fstring would actually raise a KeyError, which we fix. We also adjust the text to be correct.

Tools/build/generate_global_objects.py

index 29bd995655e0b3357d32a8f1230176608c6f860a..94905b3756d0d8775d4a0d8406b7f7f35e779038 100644 (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(