summaryrefslogtreecommitdiff
path: root/pylint/checkers/spelling.py
diff options
context:
space:
mode:
authorGanden Schaffner <gschaffner@pm.me>2020-08-22 17:39:38 -0700
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2020-09-23 08:09:41 +0200
commitd1a3fdfe4a594ef6a99aa4fb64db7fd3caec184c (patch)
treefe3ca22fd66c4f6a8d1ab729fc522db235a114bc /pylint/checkers/spelling.py
parent5728d82826543e5ed36868538b1a29d066e18085 (diff)
downloadpylint-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.py2
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: