Commits

Georg Brandl  committed 8c48e2d

Fix building with SingleHTMLBuilder when there is no toctree.

  • Participants
  • Parent commits fb80220

Comments (0)

Files changed (2)

 Release 1.0.1 (in development)
 ==============================
 
+* Fix building with SingleHTMLBuilder when there is no toctree.
+
 * Fix display names for objects linked to by intersphinx with
   explicit targets.
 

File sphinx/builders/html.py

     def get_doc_context(self, docname, body, metatags):
         # no relation links...
         toc = self.env.get_toctree_for(self.config.master_doc, self, False)
-        self.fix_refuris(toc)
-        toc = self.render_partial(toc)['fragment']
+        # if there is no toctree, toc is None
+        if toc:
+            self.fix_refuris(toc)
+            toc = self.render_partial(toc)['fragment']
+            display_toc = True
+        else:
+            toc = ''
+            display_toc = False
         return dict(
             parents = [],
             prev = None,
             rellinks = [],
             sourcename = '',
             toc = toc,
-            display_toc = True,
+            display_toc = display_toc,
         )
 
     def write(self, *ignored):