bpo-32424: Deprecate xml.etree.ElementTree.Element.copy() in favor of copy.copy() (GH-12995)

This commit is contained in:
Gordon P. Hemsley 2019-09-10 11:22:01 -04:00 committed by Stefan Behnel
parent a9b6033179
commit 7d952ded68
3 changed files with 39 additions and 0 deletions

View file

@ -195,6 +195,13 @@ class Element:
original tree.
"""
warnings.warn(
"elem.copy() is deprecated. Use copy.copy(elem) instead.",
DeprecationWarning
)
return self.__copy__()
def __copy__(self):
elem = self.makeelement(self.tag, self.attrib)
elem.text = self.text
elem.tail = self.tail