Fix incompatibility with clearing an element between ElementTree and cElementTree
This commit is contained in:
parent
c36073b40e
commit
ecd6ad6930
@ -961,8 +961,9 @@ class ElementBase(object):
|
|||||||
|
|
||||||
Any attribute values will be preserved.
|
Any attribute values will be preserved.
|
||||||
"""
|
"""
|
||||||
for child in self.xml.getchildren():
|
for child in list(self.xml):
|
||||||
self.xml.remove(child)
|
self.xml.remove(child)
|
||||||
|
|
||||||
for plugin in list(self.plugins.keys()):
|
for plugin in list(self.plugins.keys()):
|
||||||
del self.plugins[plugin]
|
del self.plugins[plugin]
|
||||||
return self
|
return self
|
||||||
|
Loading…
x
Reference in New Issue
Block a user