diff --git a/Lib/xml/dom/expatbuilder.py b/Lib/xml/dom/expatbuilder.py index 59e3ac4fefb..47d81fb1e97 100644 --- a/Lib/xml/dom/expatbuilder.py +++ b/Lib/xml/dom/expatbuilder.py @@ -269,7 +269,7 @@ def pi_handler(self, target, data): node = self.document.createProcessingInstruction(target, data) _append_child(self.curNode, node) if self._filter and self._filter.acceptNode(node) == FILTER_REJECT: - curNode.removeChild(node) + self.curNode.removeChild(node) def character_data_handler_cdata(self, data): childNodes = self.curNode.childNodes