summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2014-10-29 15:41:31 -0400
committerDan Prince <dprince@redhat.com>2014-10-29 20:32:51 -0400
commitfa52a63e4f972294fd41321b5ce0fe581a3cc03d (patch)
tree59f8ca57e8b9852c80b1f24cfe32311f4e5bb9e9 /doc
parent63e618beb137e2887eabceeb51831034d3384e40 (diff)
downloadoslo-concurrency-fa52a63e4f972294fd41321b5ce0fe581a3cc03d.tar.gz
Only modify autoindex.rst if it exists
This fixes doc build errors when using older Sphinx versions. Change-Id: I0ed9bed311d6309257c0a111671d0fea46f5da7c Closes-bug: #1387343
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/source/conf.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 4f69dc1..9fad769 100755
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -41,13 +41,15 @@ exclude_patterns = [
]
# Prune the excluded patterns from the autoindex
-for line in fileinput.input('api/autoindex.rst', inplace=True):
- found = False
- for pattern in exclude_patterns:
- if fnmatch.fnmatch(line, '*' + pattern[4:]):
- found = True
- if not found:
- print line,
+PATH = 'api/autoindex.rst'
+if os.path.isfile(PATH) and os.access(PATH, os.R_OK):
+ for line in fileinput.input(PATH, inplace=True):
+ found = False
+ for pattern in exclude_patterns:
+ if fnmatch.fnmatch(line, '*' + pattern[4:]):
+ found = True
+ if not found:
+ print line,
# The suffix of source filenames.
source_suffix = '.rst'
@@ -91,4 +93,4 @@ latex_documents = [
]
# Example configuration for intersphinx: refer to the Python standard library.
-#intersphinx_mapping = {'http://docs.python.org/': None} \ No newline at end of file
+#intersphinx_mapping = {'http://docs.python.org/': None}