1. Luke Plant
  2. sphinx


Georg Brandl  committed 09fa4e5

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

  • Participants
  • Parent commits 9ca5edd
  • Branches default

Comments (0)

Files changed (2)

File sphinx/ext/autodoc.py

View file
         # try to also get a source code analyzer for attribute docs
             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

View file
         attr_visitor = AttrDocVisitor(number2name, scope, self.encoding)
         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