remove unnecessary else clauses in for loop

This commit is contained in:
Srinivas Reddy Thatiparthy
2017-08-16 23:24:24 +05:30
parent b2f841fcaa
commit 04ff790139
3 changed files with 10 additions and 13 deletions

View File

@@ -311,7 +311,7 @@ class LiteralIncludeReader(object):
self.lineno_start += lineno self.lineno_start += lineno
return lines[lineno:] return lines[lineno:]
else:
if inclusive is True: if inclusive is True:
raise ValueError('start-after pattern not found: %s' % start) raise ValueError('start-after pattern not found: %s' % start)
else: else:
@@ -340,7 +340,6 @@ class LiteralIncludeReader(object):
return [] return []
else: else:
return lines[:lineno] return lines[:lineno]
else:
if inclusive is True: if inclusive is True:
raise ValueError('end-at pattern not found: %s' % end) raise ValueError('end-at pattern not found: %s' % end)
else: else:

View File

@@ -354,7 +354,6 @@ class BuildEnvironment(object):
for suffix in self.config.source_suffix: for suffix in self.config.source_suffix:
if fnmatch.fnmatch(filename, '*' + suffix): if fnmatch.fnmatch(filename, '*' + suffix):
return filename[:-len(suffix)] return filename[:-len(suffix)]
else:
# the file does not have docname # the file does not have docname
return None return None

View File

@@ -166,7 +166,6 @@ class SphinxFileInput(FileInput):
if isinstance(parser_class, string_types): if isinstance(parser_class, string_types):
parser_class = import_object(parser_class, 'source parser') # type: ignore # NOQA parser_class = import_object(parser_class, 'source parser') # type: ignore # NOQA
return parser_class.supported return parser_class.supported
else:
return ('restructuredtext',) return ('restructuredtext',)
data = FileInput.read(self) data = FileInput.read(self)