summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza/error.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-07-29 23:55:13 -0400
committerLance Stout <lancestout@gmail.com>2010-07-29 23:55:13 -0400
commit1da3e5b35eb59909d4d6903b1c0190a7aad98a30 (patch)
treeb409a959ed5eaa03aa3c78b21f36f3ca87800356 /sleekxmpp/stanza/error.py
parenta96a046e27289d733eabe0cb1b902e679da5d4ca (diff)
downloadslixmpp-1da3e5b35eb59909d4d6903b1c0190a7aad98a30.tar.gz
slixmpp-1da3e5b35eb59909d4d6903b1c0190a7aad98a30.tar.bz2
slixmpp-1da3e5b35eb59909d4d6903b1c0190a7aad98a30.tar.xz
slixmpp-1da3e5b35eb59909d4d6903b1c0190a7aad98a30.zip
Added unit tests for error stanzas. Corrected error in deleting conditions.
Diffstat (limited to 'sleekxmpp/stanza/error.py')
-rw-r--r--sleekxmpp/stanza/error.py4
1 files changed, 3 insertions, 1 deletions
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):