Commits

Georg Brandl  committed 09fa4e5

Really fix the problem of keeping all pgen2 parser nodes in memory.

  • Participants
  • Parent commits 9ca5edd

Comments (0)

Files changed (2)

File sphinx/ext/autodoc.py

         # try to also get a source code analyzer for attribute docs
         try:
             self.analyzer = ModuleAnalyzer.for_module(self.real_modname)
-            # parse right now, to get PycodeErrors on parsing
-            self.analyzer.parse()
+            # parse right now, to get PycodeErrors on parsing (results will
+            # be cached anyway)
+            self.analyzer.find_attr_docs()
         except PycodeError, err:
             # no source file -- e.g. for builtin and C modules
             self.analyzer = None

File sphinx/pycode/__init__.py

         attr_visitor = AttrDocVisitor(number2name, scope, self.encoding)
         attr_visitor.visit(self.parsetree)
         self.attr_docs = attr_visitor.collected
+        # now that we found everything we could in the tree, throw it away
+        # (it takes quite a bit of memory for large modules)
         self.parsetree = None
         return attr_visitor.collected