1.1 --- a/libxml2dom/__init__.py Sun May 15 19:26:04 2005 +0000
1.2 +++ b/libxml2dom/__init__.py Sun May 15 19:49:17 2005 +0000
1.3 @@ -235,7 +235,7 @@
1.4
1.5 def xpath(self, expr, variables=None, namespaces=None):
1.6 result = Node_xpath(self._node, expr, variables, namespaces)
1.7 - if hasattr(result, "len"):
1.8 + if hasattr(result, "__len__"):
1.9 return [Node(_node, self.ownerDocument) for _node in result]
1.10 else:
1.11 return result
2.1 --- a/libxml2macro.py Sun May 15 19:26:04 2005 +0000
2.2 +++ b/libxml2macro.py Sun May 15 19:49:17 2005 +0000
2.3 @@ -170,7 +170,7 @@
2.4 )
2.5 for key, value in parent.__dict__.items():
2.6 # Detect lists.
2.7 - if hasattr(value, "len") and node in value:
2.8 + if hasattr(value, "__len__") and node in value:
2.9 index = value.index(node)
2.10 value[index] = replacement
2.11 elif value is node: