# HG changeset patch # User paulb # Date 1173001553 0 # Node ID 41a8604606afdc8623d894ca394283646b3685bf # Parent 92ebe2d4517364a517a5e8ed4fdd76e716a4e55e [project @ 2007-03-04 09:45:53 by paulb] Made Node_ownerDocument return None for unowned nodes. Fixed the document ownership checking to consider unowned nodes. diff -r 92ebe2d45173 -r 41a8604606af libxml2dom/macrolib/macrolib.py --- a/libxml2dom/macrolib/macrolib.py Fri Mar 02 22:56:05 2007 +0000 +++ b/libxml2dom/macrolib/macrolib.py Sun Mar 04 09:45:53 2007 +0000 @@ -50,7 +50,7 @@ return s def check_document(node, tmp): - if Node_ownerDocument(node) is not Node_ownerDocument(tmp): + if Node_ownerDocument(tmp) is not None and Node_ownerDocument(node) is not Node_ownerDocument(tmp): raise xml.dom.DOMException(xml.dom.WRONG_DOCUMENT_ERR) def get_ns(ns): @@ -162,7 +162,7 @@ _reverseNodeTypes[value] = label def Node_ownerDocument(node): - return libxml2mod.doc(node) or node + return libxml2mod.doc(node) def Node_nodeType(node): return _nodeTypes[libxml2mod.type(node)]