diff options
Diffstat (limited to 'sphinx/directives/code.py')
-rw-r--r-- | sphinx/directives/code.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py index 7ae95b131..c08c233a7 100644 --- a/sphinx/directives/code.py +++ b/sphinx/directives/code.py @@ -314,6 +314,11 @@ class LiteralIncludeReader(object): self.lineno_start += lineno return lines[lineno:] + else: + if inclusive is True: + raise ValueError('start-after pattern not found: %s' % start) + else: + raise ValueError('start-at pattern not found: %s' % start) return lines @@ -338,6 +343,11 @@ class LiteralIncludeReader(object): return [] else: return lines[:lineno] + else: + if inclusive is True: + raise ValueError('end-at pattern not found: %s' % end) + else: + raise ValueError('end-before pattern not found: %s' % end) return lines |