diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2018-11-28 09:27:51 +0100 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2018-11-28 09:27:51 +0100 |
commit | 5046b8edf653ae2b26bb6b81ef424612380f88bf (patch) | |
tree | 575c20c638f44867d34a0a24fb93fb819243cf8a | |
parent | 7de1f56047d5939f1d5670884160301792d1d51b (diff) | |
download | pylint-git-5046b8edf653ae2b26bb6b81ef424612380f88bf.tar.gz |
Revert "Replace StopIterationCalls in ForwardSlashChunker with returns."
This reverts commit 7de1f56047d5939f1d5670884160301792d1d51b.
pyenchant was using StopIteration explicitly so there's no need to replace that
with returns as it doesn't conflict with PEP 479. The original issue had a separate problem
that wasn't related to this checker.
-rw-r--r-- | pylint/checkers/spelling.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pylint/checkers/spelling.py b/pylint/checkers/spelling.py index 7493d6b02..df99f6b3e 100644 --- a/pylint/checkers/spelling.py +++ b/pylint/checkers/spelling.py @@ -110,7 +110,7 @@ class SphinxDirectives(Filter): return bool(self._pattern.match(word)) -class ForwardSlashChunker(Chunker): +class ForwardSlashChunkder(Chunker): """ This chunker allows splitting words like 'before/after' into 'before' and 'after' """ @@ -118,7 +118,7 @@ class ForwardSlashChunker(Chunker): def next(self): while True: if not self._text: - return + raise StopIteration() if "/" not in self._text: text = self._text self._offset = 0 @@ -146,9 +146,9 @@ class ForwardSlashChunker(Chunker): if not pre_text or not post_text: break if not pre_text[-1].isalpha() or not post_text[0].isalpha(): - return + raise StopIteration() self._text = pre_text + " " + post_text - return + raise StopIteration() class SpellingChecker(BaseTokenChecker): @@ -265,7 +265,7 @@ class SpellingChecker(BaseTokenChecker): self.tokenizer = get_tokenizer( dict_name, - chunkers=[ForwardSlashChunker], + chunkers=[ForwardSlashChunkder], filters=[ EmailFilter, URLFilter, |