Fix incompatibility with clearing an element between ElementTree and cElementTree

This commit is contained in:
Lance Stout 2012-02-19 20:27:53 -08:00
parent c36073b40e
commit ecd6ad6930

View file

@ -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