1.1 --- a/libxml2macro.py Sat Apr 09 16:21:10 2005 +0000
1.2 +++ b/libxml2macro.py Sat May 14 23:30:14 2005 +0000
1.3 @@ -170,13 +170,11 @@
1.4 )
1.5 for key, value in parent.__dict__.items():
1.6 # Detect lists.
1.7 - try:
1.8 - if node in value:
1.9 - index = value.index(node)
1.10 - value[index] = replacement
1.11 - except TypeError:
1.12 - if value is node:
1.13 - parent.__dict__[key] = replacement
1.14 + if hasattr(value, "len") and node in value:
1.15 + index = value.index(node)
1.16 + value[index] = replacement
1.17 + elif value is node:
1.18 + parent.__dict__[key] = replacement
1.19
1.20 # Propagate whether the kind of result might need transforming itself.
1.21