initialize an empty dictionary for nested name key

This commit is contained in:
Tareq Al-Ahdal
2022-03-18 02:50:33 +08:00
parent d0c1b73fb3
commit d32a7c1888

View File

@@ -35,8 +35,8 @@ class _CountryInfo:
elif not isinstance(prop['languages'], list):
prop['languages'] = [x.strip()
for x in prop['languages'].split(',')]
if 'name' not in prop:
prop['name'] = {}
if 'names' not in prop:
prop['names']['name'] = {}
def items(self):
""" Return tuples of (country_code, property dict) as iterable.