From: Felix W. <Fel...@gm...> - 2005-09-03 23:19:21
|
[Resent to Docutils-users. Removed ZIP file because SF.net is blocking mail with ZIP files attached. The ZIP file has been sent to Kwok Fung, though.] Felix Wiemann wrote: > This is probably because nodes.target is not of type ClassType. Kwok, > do you have added a "__metaclass__ = type" in your > /usr/lib/python2.4/site-packages/sitecustomize.py, maybe? I.e., if you *are* setting the __metaclass__ somewhere, that's probably the reason, so you should remove that command. Otherwise, I'm sorry I have no clue what the error is because of -- I can't reproduce it. Any hints appreciated. For the meantime, if you replace the "nodes.py" file of your Docutils installation with the nodes.py in the attached ZIP file, does it work then? For developers, this is the diff: Index: docutils/nodes.py =================================================================== --- docutils/nodes.py (revision 3846) +++ docutils/nodes.py (working copy) @@ -28,7 +28,7 @@ import re import warnings from types import IntType, SliceType, StringType, UnicodeType, \ - TupleType, ListType, ClassType + TupleType, ListType, ClassType, TypeType from UserString import UserString @@ -203,7 +203,8 @@ r = [] if ascend: siblings=1 - if isinstance(condition, ClassType) and issubclass(condition, Node): + if (isinstance(condition, ClassType) or + isinstance(condition, TypeType)): node_class = condition def condition(node, node_class=node_class): return isinstance(node, node_class) -- Felix Wiemann -- http://www.ososo.de/ |