summaryrefslogtreecommitdiff
path: root/pep8.py
diff options
context:
space:
mode:
Diffstat (limited to 'pep8.py')
-rwxr-xr-xpep8.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pep8.py b/pep8.py
index d558ed4..7afe96f 100755
--- a/pep8.py
+++ b/pep8.py
@@ -796,7 +796,8 @@ def whitespace_before_inline_comment(logical_line, tokens):
if prev_end[0] == start[0] and start[1] < prev_end[1] + 2:
yield (prev_end,
"E261 at least two spaces before inline comment")
- if text.startswith('# ') or not text.startswith('# '):
+ symbol, sp, comment = text.partition(' ')
+ if symbol not in ('#', '#:') or comment[:1].isspace():
yield start, "E262 inline comment should start with '# '"
elif token_type != tokenize.NL:
prev_end = end