mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
remove unnecessary else clauses in for loop
This commit is contained in:
parent
b2f841fcaa
commit
04ff790139
@ -311,11 +311,11 @@ class LiteralIncludeReader(object):
|
||||
self.lineno_start += lineno
|
||||
|
||||
return lines[lineno:]
|
||||
|
||||
if inclusive is True:
|
||||
raise ValueError('start-after pattern not found: %s' % start)
|
||||
else:
|
||||
if inclusive is True:
|
||||
raise ValueError('start-after pattern not found: %s' % start)
|
||||
else:
|
||||
raise ValueError('start-at pattern not found: %s' % start)
|
||||
raise ValueError('start-at pattern not found: %s' % start)
|
||||
|
||||
return lines
|
||||
|
||||
@ -340,11 +340,10 @@ class LiteralIncludeReader(object):
|
||||
return []
|
||||
else:
|
||||
return lines[:lineno]
|
||||
if inclusive is True:
|
||||
raise ValueError('end-at pattern not found: %s' % end)
|
||||
else:
|
||||
if inclusive is True:
|
||||
raise ValueError('end-at pattern not found: %s' % end)
|
||||
else:
|
||||
raise ValueError('end-before pattern not found: %s' % end)
|
||||
raise ValueError('end-before pattern not found: %s' % end)
|
||||
|
||||
return lines
|
||||
|
||||
|
@ -354,9 +354,8 @@ class BuildEnvironment(object):
|
||||
for suffix in self.config.source_suffix:
|
||||
if fnmatch.fnmatch(filename, '*' + suffix):
|
||||
return filename[:-len(suffix)]
|
||||
else:
|
||||
# the file does not have docname
|
||||
return None
|
||||
# the file does not have docname
|
||||
return None
|
||||
|
||||
def doc2path(self, docname, base=True, suffix=None):
|
||||
# type: (unicode, Union[bool, unicode], unicode) -> unicode
|
||||
|
@ -166,8 +166,7 @@ class SphinxFileInput(FileInput):
|
||||
if isinstance(parser_class, string_types):
|
||||
parser_class = import_object(parser_class, 'source parser') # type: ignore # NOQA
|
||||
return parser_class.supported
|
||||
else:
|
||||
return ('restructuredtext',)
|
||||
return ('restructuredtext',)
|
||||
|
||||
data = FileInput.read(self)
|
||||
if self.app:
|
||||
|
Loading…
Reference in New Issue
Block a user