From 9561eb78f1b70117d7b0136e6ad6b7065e6a9740 Mon Sep 17 00:00:00 2001 From: arikrupnik Date: Fri, 13 Apr 2018 13:34:45 -0500 Subject: [PATCH] Compliance with DOM L1: return removed attribute W3C DOM Level 1[1] requires `removeAttributeNode()` to return the removed node: removeAttributeNode: Removes the specified attribute. Return Value: The Attr node that was removed. Current implementation returns `None`. [1]https://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-removeAttributeNode --- Lib/xml/dom/minidom.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index a5d813f932ace3..e44e04a069ecb4 100644 --- a/Lib/xml/dom/minidom.py +++ b/Lib/xml/dom/minidom.py @@ -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