From d4989135f93a21db5dbc4c2d3b06d1b8730f992e Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 16 Oct 2024 12:00:30 +0200 Subject: [PATCH] Fix check for duplicated Windows time-zone IDs A missing update of a "last" variable meant the loop inevitably did nothing useful. Include type-annotation for last, while doing this. Thankfully the check still doesn't find any duplications, now that I've fixed it so that actually would, were any present. Pick-to: 6.5 Change-Id: I672e6570359a3ff102a364d8af98c5c8c0bdc4d9 Reviewed-by: Mate Barany (cherry picked from commit 98db7a35d2ee56f5da11b4a8e745f2ee6a965077) --- util/locale_database/cldr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/locale_database/cldr.py b/util/locale_database/cldr.py index ddf5074eba5..254cb18b6b7 100644 --- a/util/locale_database/cldr.py +++ b/util/locale_database/cldr.py @@ -108,7 +108,7 @@ class CldrReader (object): 'They could be removed at the next major version.\n') # Check for duplicate entries in winIds: - last = ('', '', '') + last: tuple[str, str, str] = ('', '', '') winDup = {} for triple in sorted(winIds): if triple[:2] == last[:2]: @@ -117,6 +117,7 @@ class CldrReader (object): except KeyError: seq = winDup[triple[:2]] = [] seq.append(triple[-1]) + last = triple if winDup: joined = '\n\t'.join(f'{t}, {w}: ", ".join(ids)' for (w, t), ids in winDup.items())