Skip to content

Commit c5684f6

Browse files
committed
Do not import list patterns that have no parts
1 parent 64e8028 commit c5684f6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/import_cldr.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,11 @@ def parse_locale_display_names(data, tree):
530530

531531
def parse_list_patterns(data, tree):
532532
list_patterns = data.setdefault('list_patterns', {})
533-
for listType in tree.findall('.//listPatterns/listPattern'):
534-
by_type = list_patterns.setdefault(listType.attrib.get('type', 'standard'), {})
535-
for listPattern in listType.findall('listPatternPart'):
536-
by_type[listPattern.attrib['type']] = _text(listPattern)
533+
for list_pattern_el in tree.findall('.//listPatterns/listPattern'):
534+
pattern_type = list_pattern_el.attrib.get('type', 'standard')
535+
for pattern_part_el in list_pattern_el.findall('listPatternPart'):
536+
pattern_part_type = pattern_part_el.attrib['type']
537+
list_patterns.setdefault(pattern_type, {})[pattern_part_type] = _text(pattern_part_el)
537538

538539

539540
def parse_dates(data, tree, sup, regions, territory):

0 commit comments

Comments
 (0)