Commits

Anonymous committed 3215e05

Don't error out on reading an empty file.

Comments (0)

Files changed (2)

 * sphinx.htmlwriter: Make parsed-literal blocks work as expected,
   not highlighting them via Pygments.
 
+* sphinx.environment: Don't error out on reading an empty source file.
+
 
 Release 0.1.61798 (Mar 23, 2008)
 ================================

sphinx/environment.py

         Process the docinfo part of the doctree as metadata.
         """
         self.metadata[docname] = md = {}
-        docinfo = doctree[0]
+        try:
+            docinfo = doctree[0]
+        except IndexError:
+            # probably an empty document
+            return
         if docinfo.__class__ is not nodes.docinfo:
             # nothing to see here
             return