From ecd6ad69303466029e6498f9927964d9ee9e631b Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Sun, 19 Feb 2012 20:27:53 -0800 Subject: [PATCH] Fix incompatibility with clearing an element between ElementTree and cElementTree --- sleekxmpp/xmlstream/stanzabase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py index 648f860..96b4f18 100644 --- a/sleekxmpp/xmlstream/stanzabase.py +++ b/sleekxmpp/xmlstream/stanzabase.py @@ -961,8 +961,9 @@ class ElementBase(object): Any attribute values will be preserved. """ - for child in self.xml.getchildren(): + for child in list(self.xml): self.xml.remove(child) + for plugin in list(self.plugins.keys()): del self.plugins[plugin] return self