diff options
author | Ganden Schaffner <gschaffner@pm.me> | 2020-08-22 17:39:38 -0700 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2020-09-23 08:09:41 +0200 |
commit | d1a3fdfe4a594ef6a99aa4fb64db7fd3caec184c (patch) | |
tree | fe3ca22fd66c4f6a8d1ab729fc522db235a114bc /pylint/checkers/spelling.py | |
parent | 5728d82826543e5ed36868538b1a29d066e18085 (diff) | |
download | pylint-git-d1a3fdfe4a594ef6a99aa4fb64db7fd3caec184c.tar.gz |
Fix spell-checker crash on docstring lines that look like # comments
Diffstat (limited to 'pylint/checkers/spelling.py')
-rw-r--r-- | pylint/checkers/spelling.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pylint/checkers/spelling.py b/pylint/checkers/spelling.py index 5ac5e7b8d..3dc43f648 100644 --- a/pylint/checkers/spelling.py +++ b/pylint/checkers/spelling.py @@ -291,7 +291,7 @@ class SpellingChecker(BaseTokenChecker): initial_space = re.search(r"^[^\S]\s*", line).regs[0][1] except (IndexError, AttributeError): initial_space = 0 - if line.strip().startswith("#"): + if line.strip().startswith("#") and "docstring" not in msgid: line = line.strip()[1:] starts_with_comment = True else: |