mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
bpo-33274: Compliance with DOM L1: return removed attribute (#7465)
* bpo-33274: Compliance with DOM L1: return removed attribute * Update 2018-06-06-22-01-33.bpo-33274.teYqv8.rst
This commit is contained in:
parent
7c69c1c0fb
commit
5bfa058e65
3 changed files with 5 additions and 1 deletions
|
|
@ -325,7 +325,7 @@ def testRemoveAttributeNode(self):
|
|||
node = child.getAttributeNode("spam")
|
||||
self.assertRaises(xml.dom.NotFoundErr, child.removeAttributeNode,
|
||||
None)
|
||||
child.removeAttributeNode(node)
|
||||
self.assertIs(node, child.removeAttributeNode(node))
|
||||
self.confirm(len(child.attributes) == 0
|
||||
and child.getAttributeNode("spam") is None)
|
||||
dom2 = Document()
|
||||
|
|
|
|||
|
|
@ -823,6 +823,7 @@ def removeAttributeNode(self, node):
|
|||
# Restore this since the node is still useful and otherwise
|
||||
# unlinked
|
||||
node.ownerDocument = self.ownerDocument
|
||||
return node
|
||||
|
||||
removeAttributeNodeNS = removeAttributeNode
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
W3C DOM Level 1 specifies return value of Element.removeAttributeNode() as
|
||||
"The Attr node that was removed." xml.dom.minidom now complies with this
|
||||
requirement.
|
||||
Loading…
Add table
Add a link
Reference in a new issue