Fix python3 compatibility iteritems() with items()

This commit is contained in:
Ben 2019-04-27 00:11:32 +01:00
parent c393044949
commit f26a225c4d

View File

@ -57,11 +57,11 @@ class Spheniscidae:
data_root.set('t', 'sys') data_root.set('t', 'sys')
sub_element_parent = data_root sub_element_parent = data_root
for sub_element, sub_element_attribute in xml_dict.iteritems(): for sub_element, sub_element_attribute in xml_dict.items():
sub_element_object = SubElement(sub_element_parent, sub_element) sub_element_object = SubElement(sub_element_parent, sub_element)
if type(xml_dict[sub_element]) is dict: if type(xml_dict[sub_element]) is dict:
for sub_element_attribute_key, sub_element_attribute_value in xml_dict[sub_element].iteritems(): for sub_element_attribute_key, sub_element_attribute_value in xml_dict[sub_element].items():
sub_element_object.set(sub_element_attribute_key, sub_element_attribute_value) sub_element_object.set(sub_element_attribute_key, sub_element_attribute_value)
else: else:
sub_element_object.text = xml_dict[sub_element] sub_element_object.text = xml_dict[sub_element]