# HG changeset patch # User paulb # Date 1116186557 0 # Node ID 774d872a4668cacad9cb7f653bc85dd53221e4a6 # Parent d1322eb7c3f633425d3189efb29e22dd6ed7f26c [project @ 2005-05-15 19:49:13 by paulb] Fixed attribute check. diff -r d1322eb7c3f6 -r 774d872a4668 libxml2dom/__init__.py --- a/libxml2dom/__init__.py Sun May 15 19:26:04 2005 +0000 +++ b/libxml2dom/__init__.py Sun May 15 19:49:17 2005 +0000 @@ -235,7 +235,7 @@ def xpath(self, expr, variables=None, namespaces=None): result = Node_xpath(self._node, expr, variables, namespaces) - if hasattr(result, "len"): + if hasattr(result, "__len__"): return [Node(_node, self.ownerDocument) for _node in result] else: return result diff -r d1322eb7c3f6 -r 774d872a4668 libxml2macro.py --- a/libxml2macro.py Sun May 15 19:26:04 2005 +0000 +++ b/libxml2macro.py Sun May 15 19:49:17 2005 +0000 @@ -170,7 +170,7 @@ ) for key, value in parent.__dict__.items(): # Detect lists. - if hasattr(value, "len") and node in value: + if hasattr(value, "__len__") and node in value: index = value.index(node) value[index] = replacement elif value is node: