Closed BeastyBlacksmith closed 2 years ago
I got this error too and I dont know why. NodeVisitor method visit_Constant() of ast.py of CPython assumes that a constant has no containing Nodes. Therefore an error is raised when trying to call it with containing Nodes. Heres a quick workaround for the visit() method of doxypypys AstWalker:
def visit(self, node, **kwargs):
"""
Visit a node and extract useful information from it.
This is virtually identical to the standard version contained in
NodeVisitor. It is only overridden because we're tracking extra
information (the hierarchy of containing nodes) not preserved in
the original.
"""
containingNodes = kwargs.get('containingNodes', [])
method = 'visit_' + node.__class__.__name__
visitor = getattr(self, method, self.generic_visit)
if node.__class__.__name__ == "Constant":
return visitor(node)
return visitor(node, containingNodes=containingNodes)
This was already fixed in c0e95e4c3ecec10da9de00adae0d77bc52f3933f , 4 months ago. The doxypypy version on PyPi seems to be outdated. If you install the package via pip install git+"thisrepo" it works fine.
Yeah, a few of the listed bugs here are fixed in the current version. I'm hoping to get a new version ready for PyPi in the near future, but am trying to get a few things resolved first.
Trying doxypypy on this file got me the following error