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 <mate.barany@qt.io>
(cherry picked from commit 98db7a35d2ee56f5da11b4a8e745f2ee6a965077)
This commit is contained in:
Edward Welbourne 2024-10-16 12:00:30 +02:00
parent 38b8c15358
commit d4989135f9

View File

@ -108,7 +108,7 @@ class CldrReader (object):
'They could be removed at the next major version.\n') 'They could be removed at the next major version.\n')
# Check for duplicate entries in winIds: # Check for duplicate entries in winIds:
last = ('', '', '') last: tuple[str, str, str] = ('', '', '')
winDup = {} winDup = {}
for triple in sorted(winIds): for triple in sorted(winIds):
if triple[:2] == last[:2]: if triple[:2] == last[:2]:
@ -117,6 +117,7 @@ class CldrReader (object):
except KeyError: except KeyError:
seq = winDup[triple[:2]] = [] seq = winDup[triple[:2]] = []
seq.append(triple[-1]) seq.append(triple[-1])
last = triple
if winDup: if winDup:
joined = '\n\t'.join(f'{t}, {w}: ", ".join(ids)' joined = '\n\t'.join(f'{t}, {w}: ", ".join(ids)'
for (w, t), ids in winDup.items()) for (w, t), ids in winDup.items())