mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Don't error out on reading an empty file.
This commit is contained in:
parent
a9c0a10b78
commit
93d39ac065
2
CHANGES
2
CHANGES
@ -19,6 +19,8 @@ Changes in trunk
|
|||||||
* sphinx.htmlwriter: Make parsed-literal blocks work as expected,
|
* sphinx.htmlwriter: Make parsed-literal blocks work as expected,
|
||||||
not highlighting them via Pygments.
|
not highlighting them via Pygments.
|
||||||
|
|
||||||
|
* sphinx.environment: Don't error out on reading an empty source file.
|
||||||
|
|
||||||
|
|
||||||
Release 0.1.61798 (Mar 23, 2008)
|
Release 0.1.61798 (Mar 23, 2008)
|
||||||
================================
|
================================
|
||||||
|
@ -457,7 +457,11 @@ class BuildEnvironment:
|
|||||||
Process the docinfo part of the doctree as metadata.
|
Process the docinfo part of the doctree as metadata.
|
||||||
"""
|
"""
|
||||||
self.metadata[docname] = md = {}
|
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:
|
if docinfo.__class__ is not nodes.docinfo:
|
||||||
# nothing to see here
|
# nothing to see here
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user