From 5345e9a46ba6b862944bcddacd73fba448758109 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Thu, 14 Jan 2010 07:37:44 -0800 Subject: fixed bug from duplicate append methods in stanzabase --- sleekxmpp/xmlstream/stanzabase.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sleekxmpp/xmlstream') diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py index 277882e8..00a1439a 100644 --- a/sleekxmpp/xmlstream/stanzabase.py +++ b/sleekxmpp/xmlstream/stanzabase.py @@ -2,6 +2,8 @@ from xml.etree import cElementTree as ET import logging import traceback +xmltester = type(ET.Element('xml')) + class JID(object): def __init__(self, jid): self.jid = jid @@ -62,7 +64,10 @@ class ElementBase(object): def append(self, item): if not isinstance(item, ElementBase): - raise TypeError + if type(item) == xmltester: + return self.appendxml(item) + else: + raise TypeError self.xml.append(item.xml) self.iterables.append(item) return self -- cgit v1.2.3