Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-33274: Compliance with DOM L1: return removed attribute #7465

Merged
merged 2 commits into from
Jun 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/test/test_minidom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions Lib/xml/dom/minidom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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.