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}