diff --git a/coolamqp/framing/compilation/xml_fields.py b/coolamqp/framing/compilation/xml_fields.py index 8e108b40267cb61c7ab48e95a8e7bf4352c53733..d6dfe9b3d70a1dfb2562ff751bcb83e79a367566 100644 --- a/coolamqp/framing/compilation/xml_fields.py +++ b/coolamqp/framing/compilation/xml_fields.py @@ -60,9 +60,7 @@ class _ValueField(_Field): xmln = [xmln for xmln in self.xml_names if xmln in elem.attrib] if xmln: - xmln = xmln[0] - if xmln in elem.attrib: - return elem.attrib[xmln] + return elem.attri[xmln[0]] else: if self.default is _Required: raise TypeError('Did not find field %s in elem tag %s, looked for names %s' % (self.field_name, elem.tag, self.xml_names))