mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #1774 from pjxiao/stable
Fix #1770 literalinclude with empty file occurs exception
This commit is contained in:
commit
ca569788b1
@ -219,7 +219,7 @@ class LiteralInclude(Directive):
|
||||
|
||||
lines = self.read_with_encoding(filename, document,
|
||||
codec_info, encoding)
|
||||
if not isinstance(lines[0], string_types):
|
||||
if lines and not isinstance(lines[0], string_types):
|
||||
return lines
|
||||
|
||||
diffsource = self.options.get('diff')
|
||||
|
Loading…
Reference in New Issue
Block a user