From 41159cb1cac2724715a268e8d886ee912b4cd93f Mon Sep 17 00:00:00 2001 From: Jason Meno Date: Fri, 27 Mar 2020 19:11:16 -0400 Subject: [PATCH] Update metadata support to only key-value entries --- apple_health_xml_convert.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apple_health_xml_convert.py b/apple_health_xml_convert.py index acd9706..8bfce2b 100644 --- a/apple_health_xml_convert.py +++ b/apple_health_xml_convert.py @@ -51,8 +51,9 @@ def convert_xml(): child_attrib = child.attrib for metadata_entry in list(child): metadata_values = list(metadata_entry.attrib.values()) - metadata_dict = {metadata_values[0] : metadata_values[1]} - child_attrib.update(metadata_dict) + if len(metadata_values) == 2: + metadata_dict = {metadata_values[0]: metadata_values[1]} + child_attrib.update(metadata_dict) attribute_list.append(child_attrib)