diff options
author | Srinivas Reddy Thatiparthy <thatiparthysreenivas@gmail.com> | 2017-08-16 23:24:24 +0530 |
---|---|---|
committer | Srinivas Reddy Thatiparthy <thatiparthysreenivas@gmail.com> | 2017-08-19 20:04:47 +0530 |
commit | 04ff790139e79c9402f44d412857a351b58e55ad (patch) | |
tree | 3130704101de679da45acf730469c512ef02b251 /sphinx/directives/code.py | |
parent | b2f841fcaa34b4bde49325917a406c4bc15a5b05 (diff) | |
download | sphinx-git-04ff790139e79c9402f44d412857a351b58e55ad.tar.gz |
remove unnecessary else clauses in for loop
Diffstat (limited to 'sphinx/directives/code.py')
-rw-r--r-- | sphinx/directives/code.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py index 111f6b189..4d7e7a48d 100644 --- a/sphinx/directives/code.py +++ b/sphinx/directives/code.py @@ -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 |