stanzabase: Pass problematic object to TypeError raised by ElementBase.append()
This should help debugging those type of errors.
This commit is contained in:
parent
b94c6716f7
commit
3b2386ee2f
@ -1230,7 +1230,7 @@ class ElementBase(object):
|
|||||||
if type(item) == XML_TYPE:
|
if type(item) == XML_TYPE:
|
||||||
return self.appendxml(item)
|
return self.appendxml(item)
|
||||||
else:
|
else:
|
||||||
raise TypeError
|
raise TypeError(f"Cannot append {item!r} to a stanza")
|
||||||
self.xml.append(item.xml)
|
self.xml.append(item.xml)
|
||||||
if item.__class__ == self.plugin_tag_map.get(item.tag_name(), None):
|
if item.__class__ == self.plugin_tag_map.get(item.tag_name(), None):
|
||||||
self.init_plugin(item.plugin_attrib,
|
self.init_plugin(item.plugin_attrib,
|
||||||
|
Loading…
Reference in New Issue
Block a user