From 1da3e5b35eb59909d4d6903b1c0190a7aad98a30 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 29 Jul 2010 23:55:13 -0400 Subject: Added unit tests for error stanzas. Corrected error in deleting conditions. --- sleekxmpp/stanza/error.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sleekxmpp') diff --git a/sleekxmpp/stanza/error.py b/sleekxmpp/stanza/error.py index 3253d9c5..6d18c297 100644 --- a/sleekxmpp/stanza/error.py +++ b/sleekxmpp/stanza/error.py @@ -108,7 +108,9 @@ class Error(ElementBase): """Remove the condition element.""" for child in self.xml.getchildren(): if "{%s}" % self.condition_ns in child.tag: - self.xml.remove(child) + tag = child.tag.split('}', 1)[-1] + if tag in self.conditions: + self.xml.remove(child) return self def getText(self): -- cgit v1.2.3