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.8 6.5
Change-Id: I672e6570359a3ff102a364d8af98c5c8c0bdc4d9
Reviewed-by: Mate Barany <mate.barany@qt.io>
This commit is contained in:
Edward Welbourne 2024-10-16 12:00:30 +02:00
parent 87af2b81e4
commit 98db7a35d2

View File

@ -121,11 +121,12 @@ 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]:
winDup.setdefault(triple[:2], []).append(triple[-1])
last = triple
if winDup:
joined = '\n\t'.join(f'{t}, {w}: ", ".join(ids)'
for (w, t), ids in winDup.items())